How does javascript loop objects into arrays?

the data provided by the backend is as follows

[{avgInvestIndex:0,avgprice:3333},{avgInvestIndex:0,avgprice:3333},{avgInvestIndex:0,avgprice:3333},{avgInvestIndex:0,avgprice:3333},.......{avgInvestIndex:0,avgprice:3333}]

the effect I want

[0,3333],[0,3333],[0,3333],[0,3333],[0,3333],.....[0,3333]

this is my method

let newbox = [];
  for (let i = 0; i < _this.artdata.length; iPP) {
    newbox.push([]);
    newbox[i].push(_this.artdata[i].avgInvestIndex + "," + _this.artdata[i].avgPrice)
   }

output

["0,3333"]["0,3333"]["0,3333"]["0,3333"]["0,3333"]["0,3333"]

but what I want is a digital format. How to deal with it in this case? thank you

.
Dec.08,2021


_this = {};
_this.artdata=[{avgInvestIndex:0,avgprice:3333},{avgInvestIndex:0,avgprice:3333},{avgInvestIndex:0,avgprice:3333},{avgInvestIndex:0,avgprice:3333},{avgInvestIndex:0,avgprice:3333}];


let newbox = [];
for (let i = 0; i < _this.artdata.length; iPP) {
    newbox.push([_this.artdata[i].avgInvestIndex, _this.artdata[i].avgprice]);
}

A lot of code upstairs can solve the problem.

Menu