UNPKG

@andranik-arakelyan/js-utilities

Version:
1 lines 275 B
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.shuffle=shuffle;function shuffle(array){const result=[...array];for(let i=result.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[result[i],result[j]]=[result[j],result[i]]}return result}