Math的属性与方法
- E 返回算术常量 e,即自然对数的底数(约等于2.718)。
console.log(Math.E)

- LN2 返回 2 的自然对数(约等于0.693)。
- LN10 返回 10 的自然对数(约等于2.302)。
- LOG2E 返回以 2 为底的 e 的对数(约等于 1.414)。
- LOG10E 返回以 10 为底的 e 的对数(约等于0.434)。
- PI 返回圆周率(约等于3.14159)。
console.log(Math.PI)

- SQRT1_2 返回返回 2 的平方根的倒数(约等于 0.707)。
- SQRT2 返回 2 的平方根(约等于 1.414)。
- abs(x) 返回数的绝对值。
console.log(Math.abs(-4))

- acos(x) 返回数的反余弦值。
- asin(x) 返回数的反正弦值。
- atan(x) 以介于 -PI/2 与 PI/2 弧度之间的数值来返回 x 的反正切值。
- atan2(y,x) 返回从 x 轴到点 (x,y) 的角度(介于 -PI/2 与 PI/2 弧度之间)。
- cos(x) 返回数的余弦。
- exp(x) 返回 e 的指数。
- ceil(x) 对数进行上舍入。
console.log(Math.ceil(3.12))

- floor(x) 对数进行下舍入
console.log(Math.floor(3.72))

- log(x) 返回数的自然对数(底为e)。
- max(x,y) 返回 x 和 y 中的最高值。
console.log(Math.max(3.72,12,4,77,8))

- min(x,y) 返回 x 和 y 中的最低值。(与最大值同理)
- pow(x,y) 返回 x 的 y 次幂。
- random() 返回 0 ~ 1 之间的随机数。
- round(x) 把数四舍五入为最接近的整数。
console.log(Math.round(3.72))

- sin(x) 返回数的正弦。
- sqrt(x) 返回数的平方根。
- tan(x) 返回角的正切。
- toSource() 返回该对象的源代码。
- valueOf() 返回 Math 对象的原始值。