Basic JavaScript - Finding a Remainder in JavaScript

“TypeError: “remainder” is read-only”

I can’t seem to get what it means, I’m trying to self teach myself at the moment, any help is apricated.

We need to see your code to be able to see what’s happening. Please post your code and a link to the challenge you are working on.

Please post your actual code instead of pictures.

You cannot change the value of remainder after it is declared, because it was declared as const. You need to use the mod operator on line 1, not on line 2.

1 Like

Mod Operator? What’s that? Im new to all of this :sweat_smile:

‘mod operator’ is another name for the ‘remainder operator’.

1 Like

Im still stuck, if you could narrow it down that would great!

What did you try? Did you try removing line 2 like I suggested?

I did remove line 2, I tried doing “0 = 11 % 3;” But nothing. Sorry if I’m not catching up quickly, am a slow learner.

= is the assignment operator. You can’t assign anything to 0. You need to replace the 0 in the original code with the expression that uses %.


Dude Thank you!!! That was my problem.

1 Like

Thanks a lot it helped me :white_heart: