Thanks! Aha, I see what you mean about the jumping - it happens when you release the space bar rather than press it. It was just easier (and more succint) to code it that way.
If you're interested in javascript and code golf, checkout the js1k compo. Some really impressive stuff. For example: https://js1k.com/2010-first/demo/635
Mind = blown. ;)