Help write a loop that makes 7 calls to console. log? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Help write a loop that makes 7 calls to console. log?

I need help in writing a loop that makes 7 calls to console.log to output a string in the form of a triangle like this: # ## ### #### ##### ###### ####### Any ideas are welcome. Thanks!

8th Aug 2016, 10:30 AM
Ahmed Zaky
Ahmed Zaky - avatar
4 Antworten
+ 3
for(var line = "#" ; line.length < 8 ;line += "#") { console.log(line) }
8th Aug 2016, 4:42 PM
Daniele Capelli
Daniele Capelli - avatar
+ 1
What is line.length
11th Aug 2016, 2:14 PM
Anup Saha
Anup Saha - avatar
0
it s unternal function
15th Aug 2016, 7:19 PM
Denis Rodjonov
0
internal function
15th Aug 2016, 7:19 PM
Denis Rodjonov