Solución
solution.tsTypeScript
export function rot13(text: string): string {
const alphabet13 = "nopqrstuvwxyzabcdefghijklm".concat('nopqrstuvwxyzabcdefghijklm'.toUpperCase()).split('');
console.log(alphabet13)
const alphabet = "abcdefghijklmnopqrstuvwxyz".concat('abcdefghijklmnopqrstuvwxyz'.toUpperCase()).split('');
let result = ''
const array = text.split('');
for(let i = 0; i< array.length; i++){
if(!alphabet13.includes(array[i])){
result += array[i]
} else {
const index = alphabet.findIndex(v => v === array[i])
result += alphabet13[index]
}
}
return result;
}0respuestas