+ 1

How to use floor division in js?

Everytime I use (//) for floor division it takes the line as a comment, what do I do?

23rd Dec 2019, 4:50 AM
Yash
Yash - avatar
4 Answers
23rd Dec 2019, 10:00 AM
Gordon
Gordon - avatar
+ 4
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor JavaScript has a math library that takes care of that. You can also OR the number to 0, but, although rare, it does ciel instead
23rd Dec 2019, 5:20 AM
「HAPPY TO HELP」
「HAPPY TO HELP」 - avatar
+ 2
do you want to apply division?
23rd Dec 2019, 5:09 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 2
Yup floor division. Means only quotient
23rd Dec 2019, 5:20 AM
Yash
Yash - avatar