Javascript and tipped arrays
This question already has an answer here:
There is no a true name for that array, it's just an Array
of Object
s. To append a new Object
you have to do this:
events.push({Title: '...', ...}); //define the object to be appended
To define a new Date object you should use this constructor:
var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);
//in this case it will be(month goes from 0 to 11)
new Date(2013, 4, 5); //this will be the 5th of May(which is 4)
There are a lot of methods for the Date Object
, you just have to choose which one is the best for your purposes!
Reference to the Date Object - MDN
链接地址: http://www.djcxy.com/p/17936.html下一篇: Javascript和尖端阵列