3
我有一個數組,看起來像這樣:分組項目基於其內容
array1 = [[4000,"Mark",5],[4100,"George",3],[4000,"Mark",2],[4200,"Steve",4],[4100,"George",2],[4000,"Mark",1]]
我不知道我該如何重新格式化該陣列看起來像這樣:
array2 = [[4000,"Mark",[5,2,1]],[4100,"George",[3,2]],[4200,"Steve",4]]
很好的答案...比我更聰明:) –
謝謝你的偉大答案!定時器啓動後,我會選擇你。 – Peter