This does not work to test if its an array.
if (array) {
// empty arrays evaluate as false
}
if (array && array.length > 0) {
// you may still want to capture the array
}
const clone = array.slice(0);
const array = ['x', 'y', 'z'];
for (const key in array) {
console.log(key);
}
const array = ['x', 'y', 'z'];
for (const value of array) {
console.log(value);
}
const array3 = array1.concat(array2);