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]]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly