I have a javascript json result list - self.data.allOrganizationsList
self.data.allOrganizationsList contains list of organization whose properties are
customentityaccess, id, isLabsAccessAllowed, memberCount, organizationname, organizationwebsite
i want to access an organization object which has id = 402881702121fec10121520080930001
I am trying to get this from the below statement, but since each item in the list is an object, i am unable to get the desired result.
self.data.allOrganizationsList.id['402881702121fec10121520080930001']`
//(or)
self.data.allOrganizationsList["id"]['402881702121fec10121520080930001']
Other alternative is to use the $.each(self.data.allOrganizationList, function(index, item)).
But can i achieve the above result without iterating the - self.data.allOrganizationList
From the $.grept()
var myvar = $.grep(response.permissionedOrganizations, function(v) {
return v.id === '40288170227c142201227eb56c5c000a';
})[0];
console.log(myvar);
displays undefined in console. Am i missing something.