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 trial

JavaScript JavaScript Loops Simplify Repetitive Tasks with Loops Review while, do...while, and Loop Conditions

Complete this code by including the shorthand operator that increases the value assigned to counter by one each time....

let counter = 0;
do {
    console.log(i love javascript);
    counter_;
} while ( counter <= 9) {

2 Answers

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Treehouse Project Reviewer

Hey Syra Syra ! :wave:

Next time, please post some context, or a question as you've just posted the code from the quiz here. I assume you're stuck though so this should help you out :smiley:

It's asking us to increment counter by one each time it loops. This could be done with the += operator, like

counter += 1;

But this question is specifically asking for the shorthand operator.

The answer can be found a few steps before this quiz here, Add One To A Number

Thanks! it worked I'm so grateful.