Date without brackets in Javascript
Can you use the Date object without brackets? Yes, apparently - to a friend’s delight and my chagrin. I should know better than to rely on my somewhat shaky Javascript knowledge. This is the format for a sane Date code.. const today = new Date(); console.log(today); // 2019-08-23T09:31:12.181Z If you want to pass parameters - const firstDay = new Date(2019, 0, 1); console.log(firstDay); // 2019-01-01T00:00:00.000Z This simply means that firstDay is created by passing variables to Date, which are in turn being used by the date constructor. ...