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?.length) {
    // array or array.length are falsy
    // ⇒ do not attempt to process array
}

source