-1
我有這個javascript變量unavailabledates,我已經做了一個console.log上,我得到的數組對象。如何訪問數組內的對象的屬性?
[Object, Object, Object]
0: Object
fromDate: "2014-02-28"
toDate: "2014-02-23"
__proto__: Object
1: Object
fromDate: "2014-02-13"
toDate: "2014-02-28"
__proto__: Object
2: Object
fromDate: "2014-03-27"
toDate: "2014-03-20"
__proto__: Object
length: 3
__proto__: Array[0]
如何訪問這些對象之一的屬性?例如,我如何獲得對象編號1的fromDate?
'改編[1] .fromDate'做到這一點? – Andy
我猜'對象編號1',他意味着第一個對象,這將是'arr [0] .fromDate' – techfoobar
嗯,在他的輸出中對象被編號,所以我假設他指的是那個。 – Andy