Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check object in array javascript

var obj = {a: 5};
var array = [obj, "string", 5]; // Must be same object
array.indexOf(obj) !== -1 // True
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #check #object #array #javascript
ADD COMMENT
Topic
Name
6+9 =