Skip to content

chapter 1.1 revise #11

@cameronbourke

Description

@cameronbourke

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions