btw; arrays are nested objects and functions too; var arr = { someName : { id : 3, value : 4 }, someOtherName : { id : 4, value : 5 } }; var searchValue = 4; //or 5 for (var item in arr) { var itemData = arr[item]; if (itemData.value==searchValue) alert ('ID '+itemData.id+' has value '+searchValue); } Code (markup): theres a significant difference between var arr = [], and var arr = {}. {} creates an object, [] creates an indexed array (from 0 to length-1)