check object in array javascript

JavaScript
var obj = {a: 5};
var array = [obj, "string", 5]; // Must be same object
array.indexOf(obj) !== -1 // True
Source

Also in JavaScript: