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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user