如何在同一行输出?目前,它在垂直列表中列出;
但我想像这样“lAbI...”
代码有效。这只是输出结果的问题。请提供简单的解决方案。
var words ="kzahdjdnshdkjts";
var letters = words.split("");
var final = "";
for(let letter of letters){
if(letter === "z"){
letter = "`";
}
final = letter.charCodeAt();
final += 1;
if(final === 97){
final = 65;
}else if(final === 101){
final = 69;
}else if(final === 105){
final = 73;
}else if(final === 111){
final = 79;
}else if(final === 117){
final = 85;
}
final = String.fromCharCode(final);
console.log(final);
}