function get_reciprocal(s) {
let tmp = "";
const len = s.length;
for (let i = 0; i < len; i++) {
if (!s[i].match(/^[A-Za-z]+$/)) {
tmp += s[i];
}
else {
if (s[i] === s[i].toUpperCase()) {
tmp += String.fromCharCode('Z'.charCodeAt(0) - s[i].charCodeAt(0) + 'A'.charCodeAt(0));
}
else {
if (s[i] === s[i].toLowerCase()) {
tmp += String.fromCharCode('z'.charCodeAt(0) - s[i].charCodeAt(0) + 'a'.charCodeAt(0));
}
}
}
}
return tmp;
}
let s = "abc++deg";
s = get_reciprocal(s);
console.log(s);
/*
run:
zyx++wvt
*/