javascript fill 2 dimensional array
const fillSquareMatrix = (size) => {
return Array(size)
.fill()
.map((u,y) => Array(size)
.fill()
.map((u,x) => y * size + x + 1));
};
console.log(fillSquareMatrix(3));
Also in JavaScript:
- how to untick a checkbox with javascript
- javascript redirect example
- moment js
- javascript validation for number of characters
- how the map function works javascript
- merge sort javascript
- sql server for json path
- javascript recursion over array
- javascript randint
- javascript every
- react route multiple components
- my datatable in flutter from json repeat the column headers
- require("history").createBrowserHistory` instead of `require("history/createBrowserHistory")`
- copy text to clipboard javascript
- node_modules/metro/src/lib/attachWebsocketServer.js
- vscode new file shortcut
- javascript sum of number in object array
- javascript append how first element
- node loop files and push to array to display on screen with nunjucks
- javascript syntax highlighting pychar community
- javascript disable scrolling on body
- js add
- what is monad in javascript
- javascript storage get set item