All the hardwork done by @janbodnar please visit his website below to see more of his handiwork.
I have used his source code virtually verbatim, only adding a sligthly different fuctionality for the game mode to continue in. Thanks for the use of the code!
This was practise set as a challenge at the Meetup: Learning to code -11/9/18 - Amsterdam: http://bit.ly/2NFIthm
JavaScript Snake game sources http://zetcode.com/javascript/snake/