MCA
ADVANCED CONCEPTS // MASTER THE CONCEPTS // WRITE BRUTAL CODE // ADVANCED CONCEPTS // MASTER THE CONCEPTS // WRITE BRUTAL CODE //
BACK TO SYLLABUS
HARD

ADVANCED CONCEPTS

Closures, hoisting, this keyword, and prototypes

CONCEPTS

01Execution Context & Lexical Environment
02Hoisting and Temporal Dead Zone
03Call, Apply, and Bind
04Currying and Partial Application
05Generators & Iterables
06Proxies & Reflect API

SYNTAX_DEMO

Deep diving into JS mechanics
// Call, Apply, Bind
const person = {
  fullName: function() { return `${this.firstName} ${this.lastName}`; }
}
const p1 = { firstName: "John", lastName: "Doe" };
console.log(person.fullName.call(p1));

// Generator function
function* idMaker() {
  let index = 0;
  while (true) yield index++;
}
const gen = idMaker();
console.log(gen.next().value); // 0