User:Himmalerin/wikia.js

var myArray = [ {id:1, name:"bob"}, {id:2, name:"dan"}, {id:3, name:"barb"}, ];

// grab the Array item which matchs the id "2" var item = myArray.find(function(item) {return item.id === 2;});

// print console.log(item.name);