是否有任何漂亮的方法可以从哈希数组中获取值:
var foo = {a:“aFirst”,b:“bFirst”,c:“cFirst”}; var boo = {a:“aSecond”,b:“bSecond”,c:“cSecond”}; var bar = {a:“aThird”,b:“bThird”,c:“cThird”}; var myArrOfHashes = [foo, boo, bar];
所以我会期待这样的事情:
myArrOfHashes.map(b) // => bFirst, aSecond, aThird