I\'m not even certain what the title of this question should be - I\'m not sure what is going wrong at all.
I\'m writing a function that simply loops through a binar
Your recursive call have to return the value to the caller
function searchLeft(node, path) { if (typeof node.left == 'undefined') { console.log(path); return path; } node = JSON.parse(JSON.stringify(node.left)); path.push(node.data); return searchLeft(node, path); //here return }