开发者

Javascript Date object expression (Date within date)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜