📅  最后修改于: 2022-03-11 15:04:02.793000             🧑  作者: Mango
// Display pyramid of number using JavaScript
var totalNumberOfRows = 5;
var output = "";
for (var i = 1; i <= totalNumberOfRows; i++) {
for (var j = 1; j <= i; j++) {
output += j + " ";
}
console.log(output);
output = "";
}