Clone an Array :
const myClonedArray = Object.assign([], myArray);
Clone an object :
const myClonedObject = Object.assign({}, myObject);
Example:
this.arsCalendarRows.map(
row => {
const a = Object.assign({}, row);
delete a['emp_no'];
delete a['emp_name'];
this.arsCalendarRows2.push(a);
});
沒有留言:
張貼留言