suppose there is an array like this
var qq = [
{
"group": 100,
"info": {"event": 123},
"main": true,
},
{
"group": 100,
"info": {"event": 323},
"main": true,
"sp": 1
},
{
"group": 103,
"info": {"event": 123},
"main": true,
"sp": 13,
},
{
"group": 103,
"info": {"event": 323},
"main": true,
"sp": 10
},
{
"group": 103,
"info": {"event": 123},
"main": true,
"sp": 1
}
];
group is in the same group as the number.
I want to put sp 1 in the first group in the same group, and change main to false.
how to achieve this? Is there a big god who can try it for me?
the end result should be like this
var qq = [
{
"group": 100,
"info": {"event": 323},
"main": false,
"sp": 1
},
{
"group": 100,
"info": {"event": 123},
"main": true,
},
{
"group": 103,
"info": {"event": 123},
"main": false,
"sp": 1
},
{
"group": 103,
"info": {"event": 123},
"main": true,
"sp": 13,
},
{
"group": 103,
"info": {"event": 323},
"main": true,
"sp": 10
}
];