new not harmful. Repeat again and again.
Used correctly, new works very well. Like in the backbone.
JSLint is a very stubborn linter; just because Crockford says that something is bad or should not be used does not mean that universal truth. In addition, his reasoning behind this is more at the end that he hides Javascript prototyping behind a more classic facade.
However, if you use a tool like JSHint, you can configure these warnings.
I prefer the last of your two ads
$(function() { var instantGarbage = new MainControllerView(); });
You can suppress this with the unused: false option for JSHint.
Or you can set nonew: false instead.
They can be installed in .jshintrc or even in a comment file:
/* jshint unused: false */
At the top of the file. This will disable the file. You can even disable it for certain areas.
See the jshint documentation
tkone
source share