MCPcopy Create free account
hub / github.com/LearnPrompt/LearnPrompt / shuffle

Function shuffle

src/utils/jsUtils.ts:24–34  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

22}
23
24export function shuffle(arr) {
25 let i = arr.length
26
27 while (i) {
28 const j = Math.floor(Math.random() * i--)
29
30 ;[arr[j], arr[i]] = [arr[i], arr[j]]
31 }
32
33 return arr
34}
35
36export function upperFirst(str) {
37 if (typeof str !== 'string' || str.length === 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected