📄️ Variable scope, closure
JavaScript is a very function-oriented language. It gives us a lot of freedom. A function can be created at any moment, passed as an argument to another function, and then called from a totally different place of code later.
📄️ The old "var"
The information in this article is useful for understanding old scripts.
📄️ Function object, NFE
A function in JavaScript is a value. Every value in JavaScript has a type. What type is a function?
📄️ The "new Function" syntax
The syntax for creating a function:
📄️ Scheduling: setTimeout and setInterval
We may decide to execute a function not right now, but at a certain time later. That’s called “scheduling a call”.
📄️ Decorators and forwarding, call/apply
JavaScript gives exceptional flexibility when dealing with functions. They can be passed around, used as objects, and now we’ll see how to forward calls between them and decorate them.
📄️ Function binding
When passing object methods as callbacks, for instance to setTimeout, there’s a known problem: “losing this”.
📄️ Arrow functions revisited
Arrow functions are not just a “shorthand” for writing small stuff. They have some very specific and useful features.