0
Whats Difference b/w named and anonymous function??
let abc = function (a,b){ return a+b ; }; document.write(abc(2,3)) function add (a,b){ return a+b ; }; document.write(abc(2,3)) There is literally no difference, all same with same answers
1 Answer
+ 4
Anonymous function declarations are not candidates for variable hoisting.
This will work đ
abc(2);
function abc(n) {}
This won't work
abc(2);
let abc = function (n) {}
// cannot access abc before declaration
https://developer.mozilla.org/en-US/docs/Glossary/Hoisting