Basic JavaScript - Finding a Remainder in JavaScript

Tell us what’s happening:

The value of remainder should be 2 - I dont know how to correct this?

Your code so far

const remainder = 2;
remainder = 11 % 3;

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0

Challenge Information:

Basic JavaScript - Finding a Remainder in JavaScript

1 Like

Your solution is correct except that you cannot use the const keyword in this case, as variables declared with const cannot be reassigned. Whilst this challenge is set up to use var, this has been superseded in ES6 by let and const, so (in this case) you should really use let.

1 Like

Thank you and thanks for the links!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.