How does an anonymous function know its name?

Consider the following code. const foo = () => {}; console.log(foo.name); // prints foo const bar = foo; console.log(bar.name); // prints foo again Please point out what is wrong with my reasoning about the statement const foo = () => {};. The expression () => {} evaluates to an anonymous function object and the statement… Read More How does an anonymous function know its name?