ES6+ Flashcards
1
Q
Generate a matrix from [‘a’, ‘b’, ‘c’] and [1, 2, 3]
A
[for (row in letters) [for (col in numbers) row + col]]
2
Q
When do you use let
inside an array comprehension?
A
When it’s not wrapped in an array.
for (let a of list) log(a)
vs.
[for (a of list) a]