Files
freeCodeCamp/guide/chinese/javascript/standard-objects/math/math-random/index.md
T

400 B

title, localeTitle
title localeTitle
Math Random 数学随机

数学随机

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

句法

Math.random()

例

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

更多信息:

MDN