MCPcopy Create free account
hub / github.com/Free-APIs/Free-APIs.github.io / shuffle

Function shuffle

src/pages/Browse/index.js:96–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94 };
95
96 const shuffle = () => {
97 let shuffled = [...apis];
98 for (let i = shuffled.length - 1; i > 0; i--) {
99 const j = Math.floor(Math.random() * (i + 1));
100 [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
101 }
102 setApis([...shuffled]);
103 setSort('Random');
104 };
105
106 const reset = () => {
107 if (canStore) {

Callers 1

handleSortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected