I put this game together with the help of the following tutorial Educative.io/blog/javascript-snake-game-tutorial