Modulus question in JavaScript | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Modulus question in JavaScript

Why does 2%66 results in 2?

29th Sep 2021, 3:45 PM
zexu knub
zexu knub - avatar
1 Respuesta
+ 4
Modulus operator gives the remainder of an integer division. In your case, 2/66 gives the quotient as 0 and remainder 2. So the answer is 2
29th Sep 2021, 3:52 PM
Rishi
Rishi - avatar