Shuffle Array (Deno)
Heat | Release - Latest | Release - Pre | |
---|---|---|---|
| | () | () |
A Deno module to shuffle the array's indexes.
đ° Begin
Deno
- Target Version: >= v1.34.0
- Require Permission: N/A
- Domain/Registry:
- Deno Land
import ... from "https://deno.land/x/shuffle_array[@<Tag>]/mod.ts";
- DenoPKG
import ... from "https://denopkg.com/hugoalh-studio/shuffle-array-deno[@<Tag>]/mod.ts";
- GitHub Raw [Require Tag]
import ... from "https://raw.githubusercontent.com/hugoalh-studio/shuffle-array-deno/<Tag>/mod.ts";
- Pax
import ... from "https://pax.deno.dev/hugoalh-studio/shuffle-array-deno[@<Tag>]/mod.ts";
- Deno Land
âšī¸ Notice: Although it is recommended to import main module with path
mod.ts
in general, it is also able to import part of the module with sub path if available, but do not import if:
- it's file path has an underscore prefix (e.g.:
_foo.ts
,_util/bar.ts
), or- it is a benchmark or test file (e.g.:
foo.bench.ts
,foo.test.ts
), or- it's symbol has an underscore prefix (e.g.:
export function _baz() {}
).These elements are not considered part of the public API, thus no stability is guaranteed for them.
𧊠API
function shuffleArray<T>(item: T[]): T[];
âšī¸ Notice: Documentation is included inside the script file, can view it via:
âī¸ Example
import { shuffleArray } from "https://raw.githubusercontent.com/hugoalh-studio/shuffle-array-deno/main/mod.ts"; const chain = [3, 7, 25, 26, 42, 62, 71, 76, 92, 93]; shuffleArray(chain); //=> [62, 93, 26, 42, 25, 7, 76, 71, 3, 92] shuffleArray(chain); //=> [42, 3, 26, 62, 93, 7, 76, 25, 92, 71]