Answers for "javascript fill 2 dimensional array"

0

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));
Posted by: Guest on March-29-2020

Code answers related to "javascript fill 2 dimensional array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language