I want to transform text randomly in javascript. e.g: raNDomlYrAnDfomR
const characters = "shoaib ali khan soomro";
function generateString(length) {
let result = " ";
const charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
let length = characters.length;
console.log(generateString(length));