Array `includes`
using the includes method to process elements in an array
Even in ES5, it was easy to figure out when an element is a member of an array.
Node.js
console.log([1, 2, 3].indexOf( 2 ) >= 0);
In ES2016, the ...
using the includes method to process elements in an array
Even in ES5, it was easy to figure out when an element is a member of an array.
console.log([1, 2, 3].indexOf( 2 ) >= 0);
In ES2016, the ...