🔰composition
// ⭐️ composition of generator functions
function* alphaNumericCodes(){
yield* list(26, {start: 97}); // a..z // ⭐️ Note: use of `yield*`
yield* list(26, {start: 65}); // A..Z
yield* list(10, {start: 48}); // 0..9
}
// generator object -> array
[...alphaNumericCodes()]
.map(n => String.fromCharCode(n)) // array of codes -> array of characters
.join('') // 'a..zA..Z0..9'Last updated