function multiplier(factor) { return (x) => x * factor; } let doubler = multiplier(2); console.log(doubler(5)); // prints: 10