3 ms·
>Partial Application and .bind(). Function.bind() in JS is about setting `this` for when the function is called Everything after the first parameter to .bind()
by AgentME 10y ago
>Partial Application and .bind(). Function.bind() in JS is about setting `this` for when the function is called
Everything after the first parameter to .bind() sets regular parameters.
>Lazy evaluation should be called a generator if we are doing JS specific naming conventions.
They used a generator as an example of lazy evaluation. Not all generators are examples of lazy evaluation, and not all lazy evaluation is done with generators.
Agreed about const. In Javascript, const is purely about the variable binding being immutable, and not a statement about the value itself.
- jdmichal 10y ago> Everything after the first parameter to .bind() sets regular parameters. And if you consider `this` to be an implicit first parameter, everything makes perfect sense.
- AgentME 10y ago`this` isn't exactly like a parameter to .bind() though: the `this` value passed to the bound function is completely ignored, instead of being passed as extra arguments.