Reputation: 15
This is my code:
this.restarray.forEach(element => {
element.forEach(elt => {
let restallx = {name: elt.name, xval: elt.value};
this.restall.push(restallx);
console.log(elt.name);
console.log(this.restall);
});
});
When I print elt.name
I get multiple name's, but when i print this.restall
I get only last name and value. Anyone have idea what's wrong with my code?
Upvotes: 0
Views: 2928