for, while, if, switch and the like are keywords, statements. You can store expressions into variables though. Like: const multiplyByTwo = i => i * 2 const numbers = [1,2,3] const timesTwoNumbers = numbers.map(multiplyByTwo) // [2,4,6]
you can create a function that uses a for loop in its body
u can store generator, then iterate
Обсуждают сегодня