In theory you are playing a game against hackers. You can't win this game but you make it challenging.
My suggestion would be to use as much server side logic as you can possibly use and use Javascript Obfuscation.
Javascript obfuscation will make it extremely hard to understand the code, but even better it will make it possible for you to release several thousand versions of your code while maintaining the same code base.
I have used JScrambler to do this on one occasion. Instead of having to hack the code of 1 game, hackers will have to hack several thousand versions of the code! :)