UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

19 lines (16 loc) 388 B
/*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ "use strict"; (() => { // src/shuffleArray.ts function shuffle(array) { for (let i = array.length - 1; i > 0; i--) { const factor = Math.floor(Math.random() * (i + 1)); [array[i], array[factor]] = [array[factor], array[i]]; } return array; } })();