The base64 code above decodes to:
... stands for a bunch of random garbage that is ignored by the JS interpreter, since it's in a comment.
I found this solution by trial and error. In the end, the only really tricky part were the two newlines at the beginning of the code, needed to make the rest line up properly and to get the
Math to base64-encode into something that was available in the original character set. I first tried spaces, but
" M" base64-encodes into
"ICBN" and I needed the only available
B to encode
".po" later in the code.
"1?M" or any other similar no-op prefixes I could think of didn't work either, but newlines did.
I suspect this may not be exactly the intended solution, but whatever — it works. :)
var f = x=>eval(atob`eCp4KzEvLyAgfXBModLS4TvEn4wp1iys9YRRKC85KLIhNMC=`)
var g = x=>eval(atob`CgpNYXRoLnBvdyh4LTEsMC41KSAvLw4589CEIKKMRefipyz=`)
for (var i = -0; i <= 10; i++) console.log(i, '->', f(i), '->', g(f(i)))