gempir icon

Untitled

gempir | PRO | 09/05/21 11:20:42 AM UTC | 0 ⭐ | 513 πŸ‘οΈ | Never ⏰ | []
text |

330 B

|

None

|

0 πŸ‘

/

0 πŸ‘Ž

/* create a function named "scramble" that takes a string argument, shuffles its characters around and returns the result. */
function scramble(str: string): string {
    let result = "";
    for (let i = 0; i < str.length; i++) {
        result += str.charAt(Math.floor(Math.random() * str.length));
    }
    return result;
}

Comments