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.
1
u/Thenderick May 20 '22
Oh that makes sense. I thought it had something to do with scoping/hoisting but don't know for sure