They are scoped the same, but function declarations (function x() {}) are hoisted, while with function expressions (const x = function(){}), only the variable declaration is hoisted but not the initialization, ie x will declared but not defined until execution reaches that line.
Additionally, arrow functions have some special properties, namely that they do not bind their own this, arguments, or super. They also have an implied return if written on one line without curly brackets.
0
u/[deleted] May 20 '22
[deleted]