I have an array of object like this in javascript:
var events =
[
{
id: 'a',
title: 'Event 1 title'
},
{
id: 'b',
title: 'Event 2 title'
}
];
In order to reference event b I have to know the index of the event b, which I could find out by looping through the array and checking what is the index of the event when event's id matches b.
Is there easier way to reference event b when I know the id property of the event?