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

Quiz JavaScript Loops

Quiz Question 1 of 6 Please fill in the correct answer in each blank provided below.

Fill in the blank(s) below:
Complete this code by including the shorthand operator that increases the value assigned to counter by one each time through the loop:

let counter = 0; do { console.log('I love JavaScript!'); counter _______ ; } while ( counter <= 9)

I thought the blank should be += 1 but it keeps on telling me that it is incorrect. Why?

2 Answers

Cameron Childres
Cameron Childres
11,817 Points

I think the question is looking for a specific shorthand operator, not an operator combined with a value. Try the increment operator "++".

you're wrong

The question accepts ++ without the quotes.

help I have to show how I used the code in my portfolio but Idek the code. SOS anyone have pics? send code pics? please?