let number=3.1415927; conslole.log(~~number)//3 注:正数是向下取整,负数是向上取整 conslole.log(~number-1)//-3 //取相反数
本文标题:js取整技巧
本文链接:https://www.haomeiwen.com/subject/phsgwhtx.html
网友评论