CodingTrain / CodingTrain/Suggestion-Box

More on arrays in JS

Open
#100 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.