Arrays

(, en)

Ranges

function* range(start, end) {
    for (let i = start; i <= end; i++) {
        yield i;
    }
}

for (i of range(1, 5)) {
    console.log(i);
}

source

Empty or not?

if (!Array.isArray(array) || !array.length) {
  // array does not exist, is not an array, or is empty
  // ⇒ do not attempt to process array
}

source