Math.abs()
console.log(Math.abs(-10)); //10
Math.min(), Math.max()
console.log(Math.min(1, 2, 3, 4, 5)); //1
console.log(Math.max(1, 2, 3, 4, 5)); //5
Math.round(), Math.ceil(), Math.floor()
console.log(Math.round(0.5)); //1
console.log(Math.ceil(0.5)); //1
console.log(Math.floor(0.5)); //0
Math.pow()
console.log(Math.pow(10, 2)); //100
Math.sqrt()
console.log(Math.sqrt(100)); //10
Tomorrow better than today, Laugh at myself
- 출처 -