Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 147 Bytes

shuffle.md

File metadata and controls

9 lines (7 loc) · 147 Bytes

Array.prototype.shuffle()

Shuffle the array randomly.

let arr = [1, 2, 3, 4, 5];
arr.shuffle();
console.log(arr); // [ 2, 1, 4, 3, 5 ]