📜  JavaScript 代码示例中的向下三角形星形图案

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

代码示例1
// Downward Triangle Star Pattern in JavaScript
let numberDown = 5;
let stringDown = ''; 
for (let i=1; i<=numberDown; i++){
  for(let j=i; j<=numberDown; j++){
    stringDown += '*';
  }
  stringDown += '\n';
}
console.log(stringDown);