+ 1

new() or not new() in javascript?

12th May 2018, 2:39 AM
Cristopher Pereira Moreira
Cristopher Pereira Moreira - avatar
2 Réponses
+ 6
New is a magic keyword for me. If used before a function, that function acts like a constructor and you get an instance of it.
12th May 2018, 5:42 AM
Vikash Pal
Vikash Pal - avatar
+ 2
Im still using this word,even if I dont need it(it will create things I want without it,like new Array), but whatever,it keeps code a bit more clear to undestand.
12th May 2018, 9:35 PM
Rose Sevenyears
Rose  Sevenyears - avatar