6 lines
197 B
TypeScript
Raw Normal View History

export function randomizeCase(input: string): string {
return input
.split('')
.map(char => (Math.random() < 0.5 ? char.toLowerCase() : char.toUpperCase()))
.join('');
}