UNPKG

@lucide/helpers

Version:

A internal used package with helpers.

13 lines (12 loc) 300 B
/** * @param {array} array * @returns {array} */ export const shuffle = (array) => { // eslint-disable-next-line no-plusplus for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } return array; };