Files
aso/frontend/dashboard/src/_mock/funcs.ts
2023-07-03 11:39:08 +07:00

14 lines
403 B
TypeScript

// ----------------------------------------------------------------------
export function randomNumber(number: number) {
return Math.floor(Math.random() * number) + 1;
}
export function randomNumberRange(min: number, max: number) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
export function randomInArray(array: any) {
return array[Math.floor(Math.random() * array.length)];
}