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!

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

Kaya loves watermelon
Kaya loves watermelon
5,878 Points

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);
} while ( counter <= 9) {

2 Answers

Travis Alstrand
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 45,388 Points

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