CodingTrain / CodingTrain/Suggestion-Box
More on arrays in JS
Aperta
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 570
- Fork
- 85
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Following up from 2D array video #46, this interesting solution was pointed out to me in the YouTube comments:
``` javascript
make2Darr = function(r, c) {
return new Array(c).fill([]).map(e => new Array(r));
}
```
Would love to investigate `fill()` and `map()` in a future video. What else? There is also #89 which relates to this topic.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.