Lecture slides and code
Additional resources/reading for the curious
and the difference between
- Closures explained; see, especially the creating closures in a loop section.
- Arrow functions.
Source files we used in class
Code illustrating how to implement block scoping with functions:
Code illustrating the use of callback to perform synchronous and asynchronous filesystem reads:
Code illustrating the use of high order functions and closures:
Code illustrating the use of functions to implement modules:
Code illustrating the use of arrow function syntax for function expressions: