Nested Loop (Segi tiga)

Run Settings
LanguageJavaScript
Language Version
Run Command
let x = ''; for(let i=0; i<5; i++){ for(let j=0; j<=i; j++){ x+='*' } x+='\n' } let z = ''; for(let a=5; a>0; a--){ for(let b=0; b<a; b++){ z+='*' } z+='\n' } let n = 5; let y = ''; for(let i=1; i<=n; i++){ for(let j=1; j<=n-i; j++) { y+=' '; } for(let k=1; k<=i + (i-1); k++){ y+='*'; } y+='\n'; } console.log(y) console.log(x) console.log(z)
Editor Settings
Theme
Key bindings
Full width
Lines