创建一个 javascript 数组并保存另一个数据数组以在 Javascript 中创建一个数组。我已经按照以下提到的方式进行了尝试。
代码:
var vvv=this.new_products.length-this.quote.lines.length;
let mmm={};
if(vvv > 0){
for(var i = 0; i <= vvv-1; i++){
mmm ={...this.new_products[this.quote.lines.length+i]};
}
}
console.log(mmm);
例子:
this.new_products ->
0: {…}
1: {…}
2: {…}
3: {…}
this.quote.lines ->
0: {…}
1: {…}
输出应该是 ->
mmm->
0: {…} (this.new_products[2])
1: {…} (this.new_products[3])
当前输出->
{product_code: "khdbdvdjlhc de", description: "sscs", note: "csccc", pinned: false, third_party: 0, …}
我试过的代码不起作用。请帮我解决这个问题。
拉丁的传说
繁花如伊
相关分类