Dear experts,
I was analyzing Javascript codes and came across this line:
var date = (new Date()).getDate();
This kinda throw me off?
I am pretty new to Javascript and a little curious.
Dear experts,
I was analyzing Javascript codes and came across this line:
var date = (new Date()).getDate();
This kinda throw me off?
I am pretty new to Javascript and a little curious.
It creates a date object that is based on the exact time that the object was created.
Then getDate() gets the day of the month of the Date object. This value is stored into a variable for use.
As a beginner, you'll find lots of value in the documentation. w3schools.com has a good, usable organization: