For a given number N, print the grid as shown below using JavaScript, where N is a positive integer greater than 2.
Example output for N=3
1 1 1
1 0 1
1 1 1
Example output for N=4
1 1 1 1
1 0 0 1
1 0 0 1
1 1 1 1
See Question&Answers more detail:os