Solution
After browsing the Internet and reading some sources, I realized J Query has some limitations. My problem was being caused by the fact that when I use return then the control breaks out of the loop and the first/last result is returned depending on the logic I had used. And also considering the fact that J Query passes non-primitive types as references I decided to pass an array that my recursive function will manipulate and use it later in my code. Here is the source code.
function GetBaseChild(array, node)
{
if(node.hasOwnProperty("children")){
for(var i = 0; i < node.children.length; i++){
GetBaseChild(array, node.children[i]);
}
}else{
array.push(node);
}
}