Several places in your code you have console.log, but without any parameters. See this article on using console.log .
Also, it’s really difficult reading your code. It would greatly help if you could format it nicely and post in a code block:
Thank you.
