수학(Math) 객체란?

Math.ceil(arg) : Number

Math.ceil(0.95); // 1
Math.ceil(4); // 4
Math.ceil(7.004); // 8
Math.ceil(-0.95); // -0
Math.ceil(-4); // -4
Math.ceil(-7.004); // -7

Math.round(arg) : Number

Math.round(0.9); // 1
Math.round(0.6); // 1
Math.round(0.4); // 0

Math.floor(arg) : Number

Math.floor(5.95); // 5
Math.floor(5.05); // 5
Math.floor(5); // 5

Math.random() : Number

Math.ceil((Math.random() * 10)); // 1 ~ 10까지의 난수를 획득

Math.max(args) : Number

Math.max(1, 2, 3); // 3

let arr = [1, 2, 3, 4];
Math.max(...arr); // 4

Math.min(args): Number