|
Two commonly used methods can not be ignored on the first ~
Math.abs () absolute value
Math.random () generates 0-1 (including 0 but excluding 1) random number can not be set range, it can be understood
-------------------------------------------------- ----
Math.ceil ()
Math.floor ()
Math.round () are rounded
Math.min (val1, val2 ...)
Math.max (val1, val2 ...)
Seeing this feeling before this happens wanted to use if else to write about, in fact, with ready-made is not more convenient? |
|
|
|