javascript - ~~(0+Math.random()*51) What is the difference between adding zero and not?
仅有的幸福
仅有的幸福 2017-07-05 10:43:08
0
2
836

I tested and found no difference

~~(0+Math.random()*51)
仅有的幸福
仅有的幸福

reply all(2)
黄舟

It’s probably useless, maybe it’s a formula that has been preserved.

学霸

Who can understand the question written like this? It would be better to write it as Math.floor(Math.random() * 51).

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!