I need some help with chapter 20


#1


https://www.codecademy.com/en/courses/getting-started-v2/3/3?curriculum_id=506324b3a7dffd00020bf661#


I don't understand this:

console.log(14%3) equals 2?? I don't understand the purpose or the answers to this


console.log(14%3) equals 2??


#2

"%" symbol is called modulo. When % is placed between two numbers, it will divide the first number by the second, and then return the remainder of that division.

So, 14/3 is 4 remainder 2, but the remainder 2 is what will be returned.


#3

Alright, the '%' sign is doing the remainder. So 14 divided by 3, gives you a remainder of 2. This is used when you want to have left overs. if you want to divide it's '/'

/ = divide
% = remainder
* = multiply
+ = add
- = subtract


#4

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