Math.trunc
Math.sign
Math.log
Returns 1 for positive, 0 for zero, and -1 for negative numbers.
Math.sign(x)
아래 값을 입력하면 예제에 즉시 반영됩니다.
console
Math
console.log(Math.sign(5)); // 1 console.log(Math.sign(0)); // 0 console.log(Math.sign(-5)); // -1