I don’t know where is the problem in my code :’’)
[spoiler]
function rot13(str) { // LBH QVQ VG!
var Form = {
"A":"N",
"B":"O",
"C":"P",
"D":"Q",
"E":"R",
"F":"S",
"G":"T",
"H":"U",
"I":"V",
"J":"W",
"K":"X",
"L":"Y",
"M":"Z"
};
return arr=str.split("").map(function(x){
for (let i in Form){
if (x === i ){
return x = Form[i];
}else if (x === Form[i]){
return x = i;
console.log(x);
}else{
return x;
}
}
}).join("");
}
// Change the inputs below to test
rot13("SERR PBQR PNZC");
[/spoiler]
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher