main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function rot13(str) { // LBH QVQ VG!
	var code;
	
	var arr = str.split("").map(function (val, index) {
	
		code = val.charCodeAt(0);

		val = ( code > 64 && code < 91 ) ? String.fromCharCode( code % 26 + 65 ) : val;
      
    return val;
			
	});
	
	return arr.join('');
	
}

// Change the inputs below to test
rot13("SERR PBQR PNZC");
Native Browser JavaScript