Javascript and tipped arrays

This question already has an answer here:

  • How to append something to an array? 25 answers

  • 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和尖端阵列