The dragon curve is a nice little space filling curve made of π/2 turns.
Drawing a tiny dragon
The easiest iterative way to draw the curve is to determine in which direction to turn at each step of the curve.
The direction of the turn is given by the expression:
(((n & −n) << 1) & n) != 0
m & -m & m / 2
The Canvas API works a bit like Logo and provides simple and compact methods to move, rotate, and draw which are perfectly suited to render the dragon curve.
draw a pixel
Which becomes the following Canvas API calls:
Looping backwards is a bit more compact as you only need to check if the iterator is truthy.
All in all, the code is rather self explanatory but that's part of its charm.
Karma and all
This 121 bytes dragon punch was a nudge to JS1k 2014: Here be dragons for which I am part of the jury and waits for your submissions until the end of March 2014. As usual, this production is available on Pouet.net for comments.