JavaScript tips —— 谈谈数组乱序

前言先看一个段代码function randArr (arr) { return arr.sort(() => { return (Math.random() - 0.5); }); }目的是为了实现给定数组的乱序。利用数