using new and constructor functions is wrong and should not be used.
Read Is JavaScript's "new" keyword considered harmful? - No, it is not. A few (correct) arguments are
However, once you understand these, new
is harmless. Actually, every time you need instance initialisation plus prototypical inheritance, constructors with new
are the way to go.
They go against the prototype nature of JavaScript.
This will never change. I hardly can imagine why anyone would criticise this, prototypical inheritance is far more powerful than class inheritance. Probably they are only arguing against the syntax.
Could someone please enlighten me and show a situation where using new and constructor functions is so bad it should never be used?
It should not be used when not needed. Singletons can easily be created using the module pattern and object literals; inheritance does not help here. See Is it right to think of a Javascript Function Expression that uses the 'new' keyword as 'static' for an example.