버림: Math.floor( num )
올림: Math.ceil( num )
반올림: Math.round( num )
절삭: Math.trunc( num ) // 소수부를 무시함
floor는 -1.1이 -2가 되지만
trunc -1이 된다.
'basic > Vanilla.js' 카테고리의 다른 글
Array.prototype... (0) | 2021.04.23 |
---|---|
for...in 확장for문 (0) | 2021.04.23 |
연산자로 변수 할당하기 (0) | 2021.03.18 |
비구조화 할당 (0) | 2021.03.11 |
filter() (0) | 2021.03.07 |