for (let i = 1; i <= 6; i++) {
let str = "";
for (let j = 0; j < i; j++) {
str += "*";
}
console.log(str);
}
We can use two times For Loop to print star tower because first loop print number 1 to 6
and second loop for print star.
// Result
This result is showed in the console of any user friendly browser like as Chrome.
*
**
***
****
*****
******
0 Comments