What\'s the best method to get the index of an array which contains objects?
Imagine this scenario:
var hello = { hello: \'world\', foo: \'ba
Or prototype it :
Array.prototype.indexOfObject = function arrayObjectIndexOf(property, value) { for (var i = 0, len = this.length; i < len; i++) { if (this[i][property] === value) return i; } return -1; } myArr.indexOfObject("name", "stevie");