-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
Really cool book! Just wanted to point out something I don't think is true. In chapter 1.1 you say
squareB directly defines a function using function statement that obviously has no return. While, squreA defines an anonymous function using function expression, and assigns the function returned from function expression to a variable named squareA
Both a named function and anonymous function have a return value. Consider the following:
console.log( function foo(x) { return x } );
console.log( (x) => x );
Both of these functions would return
the function
undefined
What are your thoughts?
Metadata
Metadata
Assignees
Labels
No labels