0π
β
In the .push i used "Object.assign({}, β)
This works for me.
updatePersonnelTime() {
console.log("updatePersonnelTime", this.time);
var newtime = this.time;
newtime.controlDateTime = new Date();
if(!this.currentJob.time){
this.currentJob.time = [];
}
for (let i=0; i < this.selected.length; i++){
newtime.employeeID = this.selected[i];
console.log('this.selected[i]: ', this.selected[i]);
// added 'Object.assign in the push
this.currentJob.time.push(Object.assign({}, newtime));
console.log('this.time: ', this.currentJob);
}
this.updateJob();
this.timeRows = this.currentJob.time
},
Source:stackexchange.com