How does Js do this question? 4444 three hundred and thirty three twenty-two one twenty-two three hundred and thirty three 4444 How to do it with JS. I can only do more than one half to ask for a great god.

4444
333
22
1
22
333
4444
I can only do the first half


let map = []; // map= [4][4] js  js
let num = 4;

//  
for(let row = 0; row < num * 2 - 1; rowPP) {
  map.push([]);

  for(let col = 0; col < num; colPP) {
    map[row].push('');
  }
}

for(let row = 0; row < num; rowPP) {
  let currRow = num - row - 1;

  //    == num * 2 - 2
  for(let col = 0; col < row + 1; colPP) {
    map[currRow][col] = row + 1;
    map[num * 2 - 2 - currRow][col] = row + 1;
  }
}

console.log(map);
Menu