str.shuffle()

🔰 JSTypesStringmethods

/**
 * ⭐️ shuffleString()
 *    shuffle string
 * @param str [string] string to shuffle
 */
export function shuffleString(str){
    return shuffle(str.split('')).join('');
}

// ⭐️ string.shuffle()
String.prototype.shuffle = function(){
    return shuffleString(this);
}

Last updated