Let us assume that we have an array
var mRegions = [];
This array get's populated with following object
$.ajax(settings).done(function (response) {
for (var i in response.items[0].devices)
{
mRegions.push(
{
id: response.items[0].devices[i].id,
name: response.items[0].devices[i].name,
description: response.items[0].devices[i].description,
uid: response.items[0].devices[i].beacon.iBeacon.uid,
major: response.items[0].devices[i].beacon.iBeacon.major,
minor: response.items[0].devices[i].beacon.iBeacon.minor,
});
}
var myId = 'b1';
At some point of time, I need to get an object from this array of objects whose id matches with the given id (myID)
Is there a way to achieve this without a for...in loop?