I have read lots of paragraphs on w3schools that are telling us to avoid "new" when there is an another option. "new" Keyword is easy to use so why are they telling us to avoid it? What are the advantages of using literals?
var family = [
new Person("Bob",13),
new Person("Bo0",103),
new Person("hfg",163),
new Person("timmy",6)
]
instead of this
var family = new Array();
family[0] = new Person("alice", 40);
family[1] = new Person("bob", 42);
family[2] = new Person("michelle", 8);
which one is better or wise?
English is not my native. Please correct mistakes if possible.
Thanks.