JSFiddle - React, Tailwind, and code Playground
JavaScript
var ar = [{'id':'objectId1','foo':'bar'},{'id':'objectId4','foo':'bar'}]
var index = ar.map(function(el) {
return el.id;
}).indexOf('objectId4');
alert(index);
var ar = [{'id':'objectId1','foo':'bar'},{'id':'objectId4','foo':'bar'}]
var index = ar.map(function(el) {
return el.id;
}).indexOf('objectId4');
alert(index);