Create simple HTML5 canvas “game” using pure JavaScript

I have always been interested in games. Now that I’m learning JavaScript programming, I decided to make a simple “game” in HTML5 canvas element. Disclaimer: this is my first tutorial on building a game in JavaScript so there might be some bugs and mistakes.