MCPcopy Create free account
hub / github.com/dailydotdev/apps / shuffleArray

Function shuffleArray

packages/shared/src/lib/func.ts:210–223  ·  view source on GitHub ↗
(array: T[])

Source from the content-addressed store, hash-verified

208};
209
210export const shuffleArray = <T>(array: T[]): T[] => {
211 const newArray = array.slice();
212
213 // fisher-yates
214 for (let i = newArray.length - 1; i > 0; i -= 1) {
215 const j = Math.floor(Math.random() * (i + 1));
216
217 const temp = newArray[i];
218 newArray[i] = newArray[j];
219 newArray[j] = temp;
220 }
221
222 return newArray;
223};
224
225export const initReactModal = ({
226 modalObject,

Callers 5

AcquisitionFormInnerFunction · 0.90
PostPluginsWidgetFunction · 0.90
orderOptionsFunction · 0.90
useDeckFunction · 0.90
TokenCreatedPluginsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected