JS 優雅的取整

var a = ~~2.98 var b= 2.23 | 0 var c= 2.50 >> 0 console.log(a,b,c)//2,2,2
相關文章
相關標籤/搜索