1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 10:46:13 +02:00

Tweak the pattern page

This commit is contained in:
Phuoc Nguyen
2021-03-30 15:39:49 +07:00
parent f334b7208d
commit 65eec005cb
4 changed files with 31 additions and 31 deletions

View File

@@ -3,6 +3,8 @@
* (c) 2019 - 2020 Nguyen Huu Phuoc <https://twitter.com/nghuuphuoc>
*/
const randomFromArray = (array: number[]) => array[Math.floor(Math.random() * array.length)];
function randomFromArray<T>(array: T[]): T {
return array[Math.floor(Math.random() * array.length)];
};
export default randomFromArray;