Simply array map using HTML5 Canvas and Javascript