如何將數組元素隱藏或添加到對象中。將數組轉換爲帶有鍵和值的對象javascript
現在
arr = [
["1/1/2017",113],
["3/11/2017",58],
["3/12/2017",70],
["3/13/2017",76]
]
應該
arr = [
{date:"1/1/2017", count:113},
{date:"3/11/2017", count:58},
{date:"3/12/2017", count:70},
{date:"3/13/2017", count:76}
]
1.3K代表沒有力氣貼? – mplungjan