Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function declarations *are* hoisted #37

Merged
merged 1 commit into from
Aug 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
function declarations *are* hoisted
  • Loading branch information
arackaf committed Aug 12, 2017
commit e34bcc378eaa093848c2e2cb4aa5878ca5c8efc4
2 changes: 1 addition & 1 deletion ch09.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ people.map(({ name, ssn, ...person }) => person)

JavaScript already offered a number of ways in which we can declare functions before ES6.

Function declarations ((("function declarations")))are the most prominent kind of JavaScript function. The fact that declarations aren't hoisted means we can sort them based on how to improve code readability, instead of worrying about sorting them in the exact order they are used.
Function declarations ((("function declarations")))are the most prominent kind of JavaScript function. The fact that declarations are hoisted means we can sort them based on how to improve code readability, instead of worrying about sorting them in the exact order they are used.

The following snippet displays three function declarations arranged in such a way that the code is more linear to read.

Expand Down