3 ms·
For every use case this might be applied, .bind -a built-in function- is superior.
by tobyhinloopen 11y ago
For every use case this might be applied, .bind -a built-in function- is superior.
- josteink 11y agoI actually had to look this up, because I didn't know about it, and yes I agree. MDN documentation contains some very illustrative examples of its use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- Nemcue 11y agoWhat about a function that you want to pass around and have other actors give it arguments until it executes? Can't really do that with .bind without executing it.