Skip to content

Instantly share code, notes, and snippets.

View eddiejibson's full-sized avatar
:atom:
deploying to production at 4am

Edward Jibson eddiejibson

:atom:
deploying to production at 4am
View GitHub Profile
@iSWORD
iSWORD / shuffle.js
Last active February 15, 2023 20:11
Shuffle & Unshuffle an Array in JavaScript & Swift
// Functions
let shuffle = (inArr, seed, unshuffle = false) => {
let outArr = Array.from(inArr),
len = inArr.length
let swap = (a, b) => [outArr[a], outArr[b]] = [outArr[b], outArr[a]]
for (