獲取值有什麼巧妙的方法從哈希數組中獲取值:如何通過鑰匙在Javascript
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
對不起,但是這條線對我來說並不清楚('myArrOfHashes.map(b)// => bFirst,aSecond,aThird' )你能否詳細說明一下。 – yogi