I got this warning from variable cipher
when I was trying to change a string character at specified index.
const emojis: string[] = [/* values */];
function revealOriginEmojis(cipher: string): string {
for(let i = 0; i < cipher.length; i++){
let index: number = emojis.indexOf(cipher[i]);
cipher[i] = emojis[index];
}
return cipher;
}
So, should I create a new string variable or any better solutions? Thank you so much