Given existing googleable knowledge of function.bind and such, and the following control code:
console.log( [1, 2, 3].includes(2) ) // --> `true`
console.log( [null].map(String.prototype.toUpperCase, "abc") ) // --> `["ABC"]`
console.log( Array.prototype.includes.bind([3, 4, 5])(1) ) //--> `false`
console.log( Array.prototype.includes.bind([3, 4, 5])(4) ) // -- > `true`
_ is underscorejs, a generic utility wrapper/polyfill thing
[1, 2, 3].some(_.prototype.includes.bind(_([3, 4, 5]))) // --> `true`
But, why does this code yield this unexpected result?
console.log(
[1,2,3].some(Array.prototype.includes.bind([3,4,5])) // --> `false`
)
Edit: I know this code is bad form in its literal form, but this is a POC, the real implementation will differ (and cannot use arrow functions, thanks IE)