const clone = Object.assign({}, original);
Note: Doesn't do deep cloning. Use lodash
or underscore
const object = {x: 'a', y: 'b', z: 'c'}
for (const key in object) {
console.log(`${key}: ${object[key]}`);
}
Do not use `(for...of)` with `objects`. This will fatal with:
TypeError: page[Symbol.iterator] is not a function. (In 'page[Symbol.iterator]()', 'page[Symbol.iterator]' is undefined)
Uncaught TypeError: page[Symbol.iterator] is not a function