3 ms·
You can do a lot of the codeblock stuff with JavaScript's Function prototype (bind, apply, call): const someBlock = function () { console.log(this.a + 2 + this
by peppery-idiot 2y ago
You can do a lot of the codeblock stuff with JavaScript's Function prototype (bind, apply, call):
const someBlock = function () { console.log(this.a + 2 + this.c); }
const myFunc = someBlock.bind({a: 1, c: 3})
myFunc(); // => 6