Skip to content

Instantly share code, notes, and snippets.

@stahnni
Created May 13, 2017 07:19
Show Gist options
  • Save stahnni/4d885d356a2f47271a3b656a2848cf87 to your computer and use it in GitHub Desktop.
Save stahnni/4d885d356a2f47271a3b656a2848cf87 to your computer and use it in GitHub Desktop.
looping a triangle
/*
Looping a triangle (eloquent Javascript ex)
Write a loop that makes seven calls to console.log to output the following
triangle:
#
##
###
####
#####
######
#######
*/
for (let i = "#"; i.length <= 8; i+="#") {
console.log(i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment