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

CPU vs GPU Architecture

  CPU vs GPU Architecture CPU (Central Processing Unit) and GPU (Graphics Processing Unit) have distinct architectural differences, optimize...

Best for you