JS - which is correct, new date or new date ()?
3 answers
Both are correct, just a matter of taste.
But it's generally a good idea to use curly braces even if you don't pass any parameters, because these two snippets don't have the same score:
Incorrect
new Date.valueOf(); // to work it should be (new Date).valueOf()
Fix one
new Date().valueOf();
+3
source to share