var obs= [{id:12,val:2},{id:34,val:4}] in js code example Example: javascript get array object by id myArray.find(x => x.id === '45').foo;