使用对象分组数组项
myArray = [
{group: "one", color: "red"},
{group: "two", color: "blue"},
{group: "one", color: "green"},
{group: "one", color: "black"}]myArray = [
{group: "one", color: ["red", "green", "black"]}
{group: "two", color: ["blue"]}]group.
for (i in myArray){
var group = myArray[i].group;
//myArray.push(group, {???})}
萧十郎
繁花如伊
随时随地看视频慕课网APP
相关分类