Whats Difference b/w named and anonymous function?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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

16th Oct 2020, 10:52 AM
G. Yaseen
G. Yaseen - avatar
1 Resposta
+ 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
16th Oct 2020, 10:58 AM
Ore
Ore - avatar