2

Many authors state that one should use the literal notation when creating primitive data-types (string, number, boolean).

Means:

var demo = '123test'

... instead of ...

var demo = new String('123test')

But no one writes concrete why you should avoid the constructor-function.

Sure. It's more to write but beside that:

Can give me someone an exact example why I shouldn't use the constructor?

Respectively can write me which problems might result from the usage of the constructor?

mewi
  • 539
  • 1
  • 4
  • 11

0 Answers0