MCPcopy Index your code
hub / github.com/TejasQ/tejaskumar.com / randomizeArray

Function randomizeArray

util/randomizeArray.ts:1–4  ·  view source on GitHub ↗
(arr: any[])

Source from the content-addressed store, hash-verified

1export const randomizeArray = (arr: any[]) =>
2 arr.map(value => ({ value, sort: Math.random() }))
3 .sort((a, b) => a.sort - b.sort)
4 .map(({ value }) => value);

Callers 2

getStaticPropsFunction · 0.90
handlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected