es6 spread operator object new properties code example
Example 1: loop an object properties in ts
Object.keys(obj).forEach(e => console.log(`key=${e} value=${obj[e]}`));
Example 2: array spread operator in javascript
let arr1 = ['A', 'B', 'C'];
let arr2 = ['X', 'Y', 'Z'];
let result = [...arr1, ...arr2];
console.log(result); // ['A', 'B', 'C', 'X', 'Y', 'Z']
// spread elements of the array instead of taking the array as a whole