Okay, so I got this one pretty quick simply tricking the code adding an alert, I had very quickly already seen the relevant portion of code, but I thought it was being parsed in my source code and not originally included there (silly me, I was using firebug)
nevertheless I still wanted to know how it worked, so I started deleting unnecessary portions until I was left with the following code:
[officially b0rked by thedotmaster. no spoilers please
]To my surprise it still outputted the correct answer. I even copied it to a blank notepad and to my surprise it still worked!!!...
I considered every single possibility, like javascript libraries called
[thedotmaster pwned this spoiler], intrinsic functions, you name it... I really thought I was getting crazy!!!... 20 minutes later now of course I know what was going on... you can laugh at me...