Left Triangle Pattern in JavaScript | Stackblitz


Below Demo With Code

 *

**
***
****
*****
let n = 5;
let string = "";
for (let i = 1i <= ni++) {
  for (let j = 0j < ij++) {
    string += "*";
  }
  string += "\n";
}
console.log(string);






No comments:

Post a Comment

starter ASP.NET Core Web API project with example

Starter ASP.NET Core Web API project that follows all the best practices listed above. 🛠️ Starter Project Overview We’ll build a Produc...

Best for you