Find index of an object with a specific value stored in an array
I think the best way of doing that would be using the new ES6 function Array.prototype.findIndex:

data.findIndex(function(obj) { return obj[where] === what; })


If you don't have that function, there are good polyfills at MDN and NPM.

(if you do have full ES6, you apparently could also do

data.findIndex(obj =&gt; obj[where] === what)


but i'm still learning how that syntax works so i may be wrong there)