This guy wrote a Gameboy emulator in Javascript.
This is the most accessible guide to the internals of an emulator I've ever read. I don't know whether it's efficient or complete at all, but it actually makes sense when scanning through the source.
Tetris was pretty buggy for me in Chrome, but it runs.
It's really a testament to how fast modern Javascript engines [and CPUs] are. You would've had a damned hard time running something like this a short while ago.
Edit: Oops, I meant to put this in General Discussion... Move it if you mind, sorry.