create a javascript array and save another array of data to created an array in Javascript. I have tried it in the following mentioned way.
Code:
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);
example:
this.new_products ->
0: {…}
1: {…}
2: {…}
3: {…}
this.quote.lines ->
0: {…}
1: {…}
The output should be ->
mmm->
0: {…} (this.new_products[2])
1: {…} (this.new_products[3])
Current output->
{product_code: "khdbdvdjlhc de", description: "sscs", note: "csccc", pinned: false, third_party: 0, …}
My tried code is not working. Please help me to solve this.