Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJacob Thomas
1,660 PointsHi there, I can get my answer to run in the javascript console, however I'm getting a parse error when I submit.
Hi there, I have trouble when submitting my answer: parse error. I have copied and pasted my answer into the javascript console in google chrome and there is no error; the code appears to run without error.
Can anyone help me understand where I have gone wrong?
Thank you in advance for any assistance you can provide.
Cheers, Jacob
var count = 0;
while (count <= 25) {
document.write(`This is loop # ${count}` );
count += 1;
}
2 Answers
Steven Parker
231,122 PointsThis challenge engine apparently has not been upgraded to handle ES2015 syntax (template literals in particular).
But you don't need to output the count, you can just output 26 of anything.
document.write("anything");
Jacob Thomas
1,660 PointsMany thanks for the help on this one, Steven Parker and teofanescucosmin.
I'll remove the template literals and use
document.write("This is loop "+ count)
Thanks again
teofanescucosmin
14,058 Pointsteofanescucosmin
14,058 Points