"이중 물결표"(~~) 연산자는 이중 NOT Bitwise 연산자입니다. 더 빠르기 때문에 Math.floor() 대신 사용하십시오.
예시
이중 물결표 연산자에 대해 알아보기 위해 다음 코드를 실행할 수 있습니다 -
<html>
<body>
<script>
var a = 2;
var b,c, d;
b = ~~a;
c = Math.floor(a);
d = ~~b=== c;
document.write(b);
document.write("<br>"+c);
document.write("<br>"+d); // They are equal
</script>
</body>
</html>