3 ms·
To be fair, that context parameter has only just been removed as part of 4.0.0. Instead they recommend you change your code to be of the form: _.each(colle
by 9point6 11y ago
To be fair, that context parameter has only just been removed as part of 4.0.0. Instead they recommend you change your code to be of the form:
_.each(collection, _.bind(function, context))
Which actually seems a lot more correct than some arbitrary context parameter
- vkjv 11y agoHow is it arbitrary? It's part of the ES spec. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... I'm honestly curious why this is being removed?
- 9point6 11y agoAh, I actually didn't realise this was the case, I've always used `.bind(this)` for this kind of thing.