title: Calling the Date constructor with a Date object
body: <p>The JS documentation for <code>Date</code> claims that there are four ways to use the <code>Date</code> constructor.  From <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date" rel="noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date</a>:</p>
  
  <pre><code>new Date();
  new Date(value); // integer
  new Date(dateString); // string
  new Date(year, month[, day[, hour[, minutes[, seconds[, milliseconds]]]]]);
  </code></pre>
  
  <p>However, there seems to be a fifth way to use the constructor, by passing in a valid date object.  For example, the following works fine in the chrome console:</p>
  
  <pre><code>date = new Date() // Wed Sep 02 2015 16:30:21 GMT-0700 (PDT)
  date2 = new Date(date) // Wed Sep 02 2015 16:30:21 GMT-0700 (PDT)
  </code></pre>
  
  <p>They are different objects, so it seems like an easy way to make a copy of a date:</p>
  
  <pre><code>date2 === date // false
  date.setMonth(1) // 1422923421090
  date // Mon Feb 02 2015 16:30:21 GMT-0800 (PST)
  date2 // Wed Sep 02 2015 16:30:21 GMT-0700 (PDT)
  </code></pre>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>Why is this not in the official documentation? Am I missing something?</li>
  <li>Is this an officially supported use of the constructor? Will it work on all platforms/browsers?</li>
  <li>Is this a safe way to make a copy of a <code>Date</code> object, replacing e.g. <code>date2 = new Date().setTime(date.getTime())</code>?</li>
  </ol>