Files
freeCodeCamp/guide/chinese/javascript/standard-objects/math/math-random/index.md
2018-10-16 21:32:40 +05:30

400 B
Raw Blame History

title, localeTitle
title localeTitle
Math Random 数学随机

数学随机

Math.random()返回0包括和1不包括之间的数字。

句法

Math.random()

function randomInRange(min, max) { 
  return Math.random() * (max - min) + min; 
 } 

更多信息:

MDN