You are viewing a single comment's thread. Return to all comments →
let alpha ="abcdefghijklmnopqrstuvwxyz" let result=[]; for (let i of s) {if(i.toUpperCase() == i.toLowerCase()) result.push(i) for(let j=0; j<alpha.length; j++) { if(i==alpha[j] ) result.push(alpha[(j+k) % alpha.length]) else if(i ==alpha[j].toUpperCase() ) result.push(alpha[(j+k) % alpha.length].toUpperCase()) } }
Seems like cookies are disabled on this browser, please enable them to open this website
Caesar Cipher
You are viewing a single comment's thread. Return to all comments →
> * ***function caesarCipher(s, k) {