---
title: Generate Random Fractions with JavaScript
localeTitle: 使用JavaScript生成随机分数
---
JavaScript有一个`Math.random()`函数，可生成一个随机十进制数。