📜  javascript代码示例中的数字金字塔

📅  最后修改于: 2022-03-11 15:04:02.793000             🧑  作者: Mango

代码示例1
// 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 = "";
}