1) Check if an array contains a string · First, return a new array that contains all elements in lowercase using the map() and toLocaleLowerCase() methods. · Then ... ... <看更多>
... an array/string contains something. Nothing fancy, but without a library you'll need this as array.indexOf doesn't work in IE8 and lower. - contains.js. ... <看更多>
\begingroup It seems you've replicated the native JS array indexOf function. While there's no exact match for Ruby's include? in JavaScript, a simple array. · 1. ... <看更多>