I having trouble to understand why the new keyword is facultative for javascript API object/interface feature.
d = new String(); // javascript native object
d2 = String();
console.log(d);
console.log(d2);
results in console (that seems pretty normal):
String {}
(an empty string)
but:
b = new Blob(); // API object
b2 = Blob();
console.log(b);
console.log(b2);
results:
Blob { size=0, constructor=function(), type="", more...}
Blob { size=0, constructor=function(), type="", more...}
and not:
Blob { size=0, constructor=function(), type="", more...}
Blob() is undefined or (an empty blob)
It all work just fine but I'm curious...
newinstance within them if you omit it. make your own factory function and try the same.Dateandnew Date()