开发者

Javascript Date object expression (Date within date)

开发者 https://www.devze.com 2022-12-22 23:43 出处:网络
I was analyzing Javascript codes and came across this line: var date = (new Date()).getDate(); This kinda throw me 开发者_如何学编程off?

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:

http://www.w3schools.com/jsref/jsref_getDate.asp

0

精彩评论

暂无评论...
验证码 换一张
取 消