MZ
Size: a a a
MZ
MZ
MZ
Р
Р
A
Р
Р
AP
PM
PM
PM
PM
PM
МТ
ER
A
A
D
Object.defineProperty(Array.prototype, 'shuffle', {
value: function() {
for (let i = this.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[this[i], this[j]] = [this[j], this[i]];
}
return this;
}
});
D
Object.defineProperty(Array.prototype, 'shuffle', {
value: function() {
for (let i = this.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[this[i], this[j]] = [this[j], this[i]];
}
return this;
}
});
arr = Array.from(Array(10).keys());
(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
arr.shuffle()
(10) [4, 3, 9, 5, 0, 1, 8, 2, 6, 7]