daily pastebin goal
77%
SHARE
TWEET

Untitled

a guest May 24th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const date1 = new Date();
  2. console.log(date1);
  3.  
  4. // дата передастся по ссылке:
  5. // const date2 = date1;
  6.  
  7. // .getTime() => timestamp, количество миллисекунд, от 1 янв 1970
  8. // чтобы сделать копию:
  9. const date2 = new Date(date1.getTime());
  10. console.log(date2);
  11.  
  12. console.log('==============');
  13.  
  14. date2.setDate(1);
  15. console.log(date1);
  16. console.log(date2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top