Im pretty new to javascript and would love some help on my problem here. So what I am trying to do is to extract the value of "group" from my object array using the id value. The object array is in the following format: y = [{"id":id,"group":group, "sid":sid}]
. Have looped through the array as shown below. How do I extract the group value? Thanks!
y = [{id:123, group:2, sid:32}];
id = 123
for (var i = 0; i < y.length; i++) {
if (y[i].id == id) {
//Get group value for id "123" here
}
}