1. 程式人生 > >js生成四位隨機數的簡便方法

js生成四位隨機數的簡便方法

while alert 隨機 out 簡便 logs math clas pre

  • do
    out = Math.floor(Math.random()*10000);
    while( out < 1000 )
      alert( out );

js生成四位隨機數的簡便方法