Not even an error message


#1

https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/2/4?curriculum_id=506324b3a7dffd00020bf661#

When ran, it shows just { }


var a;
for (a = 1; a < 8; a++)
{
  var tree = "#"* a; {
    console.log(tree);
  }
}


#2

@pencilandpaper
Here the Javascript way found with google search
== discussions / opinions ==
javascript repeating a string site:stackoverflow.com
http://stackoverflow.com/questions/4549894/how-can-i-repeat-strings-in-javascript


#3

Thank you. From that page. I opened another page of similar problem. Got a hint there and changed my line to
console.log('#'.repeat(a))
It worked.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.