Hacker News new | ask | show | jobs
by peppery-idiot 574 days 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