Read the entire article here! http://www.lostdecadegames.com/how-to-make-a-simple-html5-canvas-game/
I used this article to first understand how canvas works. Then I found this https://github.com/alvincrespo/simple_canvas_game/tree/oopsimple in the comments of the above article. This is a great way to understand both canvas and advanced javascript.
I then used Construct2 demo version to replicate the exact same game. It is unbelievable how fast it was to build the exact same game in construct2 without a single line of code. I have uploaded a construct2 project file. If you would like to see how it works, download a demo version of construct2 and open this file in it.