1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Print the multiplication table from 1 to 10 (inclusive)
let output;
// Rows (1 top, 10 bottom)
for (let y = 1; y <= 10; y++) {
output = ''; // Make sure it is a string
// Columns (1 left, 10 right)
for (let x = 1; x <= 10; x++) {
// Build the output row
output += x*y + "\t";
}
// Print the row
console.log(output);
}
Enter to Rename, Shift+Enter to Preview