DEV Community

Discussion on: JavaScript Arrow Functions Explained

Collapse
 
fabienh profile image
fabien huet • Edited

fat arrow functions and functions are not the same thing

blog.wax-o.com/2020/03/es6-and-esn...

They are not "a way to reduce the lines of code around writing functions". They are a new feature of the language that does not behave exactly like functions.

Do:
const a = function(){};
console.log(a.prototype);
=> look for the [[Scopes]] in the constructor.

Now try the same with:
const b = () => {};