JavaScript Tutorial

Meta-Programming

Programs that can read or modify their own code.

function createMultiplier(n) {
  return x => x * n;
}
const double = createMultiplier(2);
console.log(double(5)); // 10