摘要: 数组 数组的遍历1 `function ss() { for (var i = 0; i p) { return 1; } else { return 0;} });` 随机排列一个数组 `suiji.sort(function () { if (Math.random() 阅读全文
posted @ 2019-04-20 10:02 陈国松 阅读(385) 评论(0) 推荐(1) 编辑
摘要: Math.PI 随机数以及向下取整 这是一个能实现从a b之间随机打印一个整数 `function rand_s(a, b) { var x = a + (b a) Math.random(); return Math.floor(x); } console.log(rand_s(0, 1000)) 阅读全文
posted @ 2019-04-20 09:45 陈国松 阅读(418) 评论(0) 推荐(1) 编辑