Skip to content
Open
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
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
statusMessage.value = body
}

Note that the `function` declarations here are defined at the bottom of the file. This is thanks to [function hoisting](https://gist.github.com/maxogden/4bed247d9852de93c94c).
Note that the `function` declarations here are defined at the bottom of the file. This is thanks to [function hoisting](https://developer.mozilla.org/en-US/docs/Glossary/Hoisting).

## 2. Modularize

Expand Down Expand Up @@ -225,7 +225,7 @@
### Summary

1. Don't nest functions. Give them names and place them at the top level of your program
2. Use [function hoisting](https://gist.github.com/maxogden/4bed247d9852de93c94c) to your advantage to move functions 'below the fold'
2. Use [function hoisting](https://developer.mozilla.org/en-US/docs/Glossary/Hoisting) to your advantage to move functions 'below the fold'
3. Handle **every single error** in every one of your callbacks. Use a linter like [standard](http://standardjs.com/) to help you with this.
4. Create reusable functions and place them in a module to reduce the cognitive load required to understand your code. Splitting your code into small pieces like this also helps you handle errors, write tests, forces you to create a stable and documented public API for your code, and helps with refactoring.

Expand Down