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
.
The const declaration declares block-scoped local variables. The value of a constant can't be changed through reassignment using the assignment operator, but if a constant is an object, its properties can be added, updated, or removed.
In JavaScript, you can declare variables with the var, let, and const keywords. But what are the differences between them? That's what I'll explain in this tutorial. I have a video version of this topic [https://youtu.be/Gd_JG3e1g4A] you can check...
1 Like
Thank you and thanks for the links!
system
Closed
May 31, 2024, 2:31am
4
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.