Tag Archives: contains

551 views

JS Check if an array contains an value or object JavaScript

Tthis code works in all previous versions of browsers // use === function contains(arr, valueOrObject) { for (var i = 0; i < arr.length; i++) { if (arr[i] === valueOrObject) { return true; } } return false; }   // … Continue reading

Posted in Javascript css html | Tagged | Comments Off on JS Check if an array contains an value or object JavaScript