2016-11-04 93 views

回答

0

由於array每一個元素都有對象像{id: number},你應該推objectid屬性裏面arraynumber值。

array.push({id: i}) 
+0

它顯示我同樣的錯誤,如果我在對象中添加字符串。 例如'array = [{id:1,title:'name'}];' – w3debugger

+0

@ w3debugger什麼是您的實際對象結構? –

+0

'{ ID:1, userImage: '崔西·麥葛雷迪-avatar.jpg', 用戶名: '崔西·麥葛雷迪', 距離: '500米', postImage: 'leaf_iphone_case_hard_plastic.jpg', 價格: '230 AED', likesCount:32, postText: '葉iPhone案例硬塑料', postTags:[ 'iphone', '殼體', '移動', '電話', '的MacBook'], commentCount:12, }' – w3debugger

相關問題