I understand Hoisting of variables is done in Java Script. I am unable to get why it outputs as undefined
do_something() { var foo = 2; cons
Only the declaration is hoisted, any assignment to a variable always stays where its originally from.