if we have a javascript object
var calories = { apple:200, pear:280, banana:300, peach:325 }
what is best way to find the (first) fruit that has 280 calories?
could Object.getOwnPropertyNames(calories).forEach... but there should be a better way.
For example, I was thinking of Array.prototype.indexOf() which does the same thing for an Array.
Linear search using
for..inconstruct: