📜  金字塔 javascript 代码示例

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

代码示例1
function generatePyramid() {
    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 = '';
    }
} generatePyramid();