Commit e446b90b authored by 范雪寒's avatar 范雪寒

feat: 新增utils函数 between 用来返回三个数中中间的那个

parent d1463387
......@@ -52,6 +52,10 @@ export function RandomInt(a, b = 0) {
return Math.floor(Math.random() * (max - min) + min);
}
export function Between(a, b, c) {
return [a, b, c].sort((a, b) => a - b)[1];
}
export function randomSortByArr(arr) {
const newArr = [];
const tmpArr = arr.concat();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment