js 에서 Math 의 random, round, ceil, floor 의 용법

1.Math.random();    0-1       (  0,   1) 


2.Math.floor(num);   num     ,     num     (      n     )。

 
3.Math.round(num);   num     ,     num        。


4.Math.ceil(n);       n     。


5.Math.ceil(Math.random()*10); ,    1 10     , 0     。


6.Math.round(Math.random());     0 1     。


7.Math.round(Math.random()*10); ,       0 10     ,       0    10      。


8.Math.floor(Math.random()*10); ,     0 9     。

좋은 웹페이지 즐겨찾기