Workshop.js
/**
     * Hard copies an array and shuffles its contents randomly
     *
     * @param {array} array The array that will be hard copied and shuffled
     */
Hard copies an array and shuffles its contents randomly
@param {array} array The array that will be hard copied and shuffled
Hard copies an array and shuffles its contents randomly @param { array } array The array that will be hard copied and shuffled
shuffle(array) {
        const tempArray = array.slice();
        const returnArray = [];
        while (tempArray.length) {
            const randomIndex = Math.floor(Math.random() * tempArray.length);
            returnArray.push(tempArray[randomIndex]);
            tempArray.splice(randomIndex, 1);
        }
        return returnArray;
    }
shuffle ( array ) { const tempArray = array . slice ( ) ; const returnArray = [ ] ; while ( tempArray . length ) { const randomIndex = Math . floor ( Math . random ( ) * tempArray . length ) ; returnArray . push ( tempArray [ randomIndex ] ) ; tempArray . splice ( randomIndex , 1 ) ; } return returnArray ; }
Hard copies an array and shuffles its contents randomly
 @param {array} array The array that will be hard copied and shuffled
Hard copies an array and shuffles its contents randomly @param { array } array The array that will be hard copied and shuffled