4 - Advanced Concepts
Closures in Depth
What are Closures?
function makeMultiplier(x) { return function(y) { return x * y; }; } const multiplyBy3 = makeMultiplier(3); console.log(multiplyBy3(4)); // Output: 12 console.log(multiplyBy3(5)); // Output: 15
Use Cases of Closures
function Counter() { let count = 0; return { increment: function() { count++; return count; }, decrement: function() { count--; return count; } }; } const counter = Counter(); console.log(counter.increment()); // Output: 1 console.log(counter.decrement()); // Output: 0
Higher-Order Functions
What are Higher-Order Functions?
Common Higher-Order Functions
The this Keyword in JavaScript
this Keyword in JavaScriptUnderstanding this
thisPrototypes and Inheritance
What is a Prototype?
Inheritance
Classes in JavaScript (ES6)
The Event Loop and Asynchronous JavaScript
The Event Loop
Asynchronous JavaScript
Summary
Last updated