% operator not recognised

Tell us what’s happening:
Why is it not recognising the % operator in my code?

Your code so far
// Only change code below this line

var remainder = 11 % 3

// Only change code below this line

var remainder = 11 % 3

I’ve also tried
// Only change code below this line

var remainder;

remainder = 11 % 3

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36.

Challenge: Finding a Remainder in JavaScript

Link to the challenge:

Hmm… I did the same thing you did and the tests passed for me.

Some basic troubleshooting - ensure that you don’t have any browser extensions enabled that access the FCC website. If that does not help, try a different browser; Chrome is the officially supported browser for the FCC curriculum.

1 Like

You are missing the semicolon ; at the end.


Bahaha oh man. Pesky semicolons! Lesson learned. Thanks so much :slight_smile:

1 Like

The curriculum can be a bit strict about such things, even if it isn’t strictly necessary for valid code. We do enforce using semicolons (for the most at least).

I think it is best when first starting out learning to have that rule in place. Then later when you know about ASI you can decide if you want to use semicolons in your own code or not.

I would suggest using them, but it’s kind of a tab vs spaces debate that isn’t always fruitful. Just know there are a few caveats to not using semicolons.

Happy coding.

1 Like