learning a bit of javascript to draw pixels on a canvas