Right Triangle Pattern in JavaScript | Stackblitz

 

Below Code With Demo

     *
   **
  ***
 ****
****

let n = 5;
let string = "";
for (let i = 1i <= ni++) {
  // printing spaces
  for (let j = 0j < n - ij++) {
    string += " ";
  }
  // printing star
  for (let k = 0k < ik++) {
    string += "*";
  }
  string += "\n";
}
console.log(string);





No comments:

Post a Comment

commonly used in modern ASP.NET Core apps more examples using fetch + Blob in JavaScript to download files PDF, Excel

 Let’s explore real-world examples using the fetch + blob pattern, targeting different file types and scenarios. ✅ 1. Download Static PD...

Best for you