Do you have a habit running JSLint for your JavaScript code? If you do not have it because the running is tedious, then IDE can help you with it while you edit the code. Here is how.
Open Settings, type JSLint, enable an inspection, configure the options. Hit apply.
Here you go, errors from JS…