In This code,
const prompt = require("prompt-sync")();
const readline = require("readline-sync");
let rows = parseInt(readline.question("Enter The row: "));
let Columns = parseInt(readline.question("Enter The columns: "));
let arr = [];
console.log("Enter The matrix: ");
for (let i = 0; i < rows; i++) {
arr.push([]);
for (let j = 0; j < Columns; j++) {
arr[i].push(parseInt(readline.question()));
}
}
console.log(arr);
I’m not able to take the user input correctly. It is not terminating after the for loop. Can someone help me please?