My challenge is to create a function that takes in a string and returns a new string with each character advanced 1 space of the alphabet. Ex: "hello" returns "ifmmp."
I haven't yet wrapped my code in a function. This will get me the first new character but I can't figure out how to move through the rest of the new characters.
var str = "hello";
var numStr = [];
for (var i = 0; i < str.length; i++) {
numStr.push((str.charCodeAt(i) + 1));
}
var newStr = String.fromCharCode(numStr[0]);
//returns "i"