random 产生随机数


console.info(_.random(0, 5));
// => an integer between 0 and 5
 
console.info(_.random(5));
// => also an integer between 0 and 5
 
console.info(_.random(5, true));
// => a floating-point number between 0 and 5
 
console.info(_.random(1.2, 5.2));// 设置 true false都会是浮点数;
// => a floating-point number between 1.2 and 5.2

posted @   盘思动  阅读(22)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2019-12-21 ubuntu 16 typora 安装 ,14系统的不管用。。
2018-12-21 intval floatval
2018-12-21 PHP_EOL 写入字符串换行 , php获取毫秒 microtime
2018-12-21 获取最近的配送日期
2017-12-21 lnmp 环境搭建
2017-12-21 phpstorm 安装
点击右上角即可分享
微信分享提示