0
Why do we use" new" before ARRAY and DATE in declaration??
3 Answers
0
Because Date is a constructor. To create a constructor like that:
function Obj(text) {
this.text = text;
change = function() {
this.text = "some text";
}
}
//to create a new Obj:
var obj = new Obj();
0
what happens if we don't use "new"
0
It don't works (I suppose)