Basic JavaScript - Finding a Remainder in JavaScript

Tell us what’s happening:
Describe your issue in detail here.
Hello! I am taking the Basic JavaScript course and I have been trying to find this solution for over an hour now. I have watched the video multiple times and looked at all of the hints and I have tried using all of the different suggestions people are giving in the hint section. I am still greatly confused and struggling a lot! Please explain it to me and help me figure out the answer! Thank you!

Your code so far

const remainder = 0;

2 % 11;

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14695.107.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Basic JavaScript - Finding a Remainder in JavaScript

Link to the challenge:

You changed this to use const so you won’t be able to change the value of remainder. Change it back to var or let.

This line does execute the statement but doesn’t do anything with the result, so it is basically not doing anything. Also, it is not doing what the instructions asked, which is:

“Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.”

So you should be using the numbers 11 and 3 with the % operator. And then you need to set remainder to the result of that operation. You can do this all in one line. Originally the line is:

var remainder;

Just set remainder to the result of the operation.

1 Like

you want to see remainder of “2/11” for this you must do like followin
let a = 2%11; //this line will divide 2 by 11 and store the remainder in variable a.
console.log(a); // this line will print the value stored in a i.e. remainder of 2/11.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

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