3 ms·
You should know that they exist and what they do. You can do a lot of things with higher-order functions just by making closures, but `apply` and `call` will g
by bulatb 13y ago
You should know that they exist and what they do.
You can do a lot of things with higher-order functions just by making closures, but `apply` and `call` will give you flexibility and power there's no other way to get. For one thing, they're your ticket to manipulating `this`.
The worst part is keeping them straight. My mnemonic is that `call` is just a function call, so arguments go in as normal. `apply` is the other one, so arguments go in as an array. (Maybe "A" for array, or something.)
- berodam 13y agoMy usual mnemonic is "call list" and "apply array"