Tell us what’s happening:
Can Anyone explain “/[A-Z]/G, L => String.fromCharCode” part of the code given below ?
Your code so far
function rot13(str) { // LBH QVQ VG!
return str.replace(/[A-Z]/g, L => String.fromCharCode((L.charCodeAt(0) % 26) + 65));
}
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/caesars-cipher