Tell us what’s happening:
Hi there, i am trying to convert str to an Array with the ASCII code but I dont know what I am doing wrong and my newArray is not storing the values…
Your code so far
function rot13(str) { // LBH QVQ VG!
var newArray = [];
var corto= str.split("");
for (var i=0; i<corto.lentgh; i++){
newArray.push(corto.charCodeAt([i]));
}
return newArray;
}
// Change the inputs below to test
rot13("SERR PBQR PNZC");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/caesars-cipher