Greetings! I am a newcomer to the world of JavaScript and could really use some assistance with a specific issue that I'm currently facing.
Essentially, I have an array that is storing objects, each of which has an id and a variable i which is a number. My main query is this: how can I retrieve the value of i from the object array using the id value? The id that I will be using would have already been stored in the array along with an i value.
var i = 1;
var id;
var b = {};
var y = [];
if(condition) {
b = {"123":i};
y.push(b);
}
if(condition) {
id = 123;
//To retrieve the corresponding i value for id "123" from the object array y
i = ?;
}