Script – 16-19 Jan 27

I'm trying to do Caesar cipher I already wrote the logic to flip the alphabets, but now I'm not sure how to write my for loop to index the respective alphabets and get the encrypted text
function caesarCipher(s, k) {
let alphabets = "abcdefghijklmnopqrstuvwxyz";
let oA = alphabets.split("",k).join("")
let aa = alphabets.split("",26).reverse().join("")
aa = aa.split("",26-k).reverse().join("")
aa = aa.concat(oA)

for(i=0; i<= ; i++) {}

}
console.log(caesarCipher("middle-Outz", 3))
function caesarCipher(s, k) {
let alphabets = "abcdefghijklmnopqrstuvwxyz";
let oA = alphabets.split("",k).join("")
let aa = alphabets.split("",26).reverse().join("")
aa = aa.split("",26-k).reverse().join("")
aa = aa.concat(oA)

for(i=0; i<= ; i++) {}

}
console.log(caesarCipher("middle-Outz", 3))
UU
Unknown User811d ago