如何從javascript對象創建不同屬性的列表?Javascript對象屬性清單
下面是一個簡單的字符串,是動態創建這個字符串(我不知道是什麼屬性和值可能含有。
[{
"ID": 331,
"DynamicString": "",
"MyDate": "",
"TestCheckbox": "false",
"TestTA": "",
"BusinessCategory": "Regulatory",
"PriorityGroup": "Must Do"
}, {
"ID": 335,
"DynamicString": "hjkhjkhjk",
"MyDate": "17/02/2016",
"TestCheckbox": "true",
"TestTA": "hjkhjkhjk",
"BusinessCategory": "Regulatory",
"PriorityGroup": "Should Do"
}, {
"ID": 336,
"DynamicString": "What about this",
"MyDate": "26/05/2016",
"TestCheckbox": "false",
"TestTA": "What about this",
"BusinessCategory": "Machinery of Government",
"PriorityGroup": "Should Do"
}]
我想輸出是
「 ID,DynamicString,MyDate,TestCheckBox,TestTA,BusinessCategory,PriorityGroup
我將數據傳遞給一個對象,但我不確定循環並創建一個不同的屬性列表的最佳方式。
已每個項目相同的屬性? –