How to copy a date object? #5860
Replies: 3 comments 3 replies
-
If I were trying to determine the answer to this question, I would remove the |
Beta Was this translation helpful? Give feedback.
-
It does? Where? |
Beta Was this translation helpful? Give feedback.
-
The link is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date The syntax used to create the sourceObj is list below
|
Beta Was this translation helpful? Give feedback.
-
In the source code, lodash uses "new Date(+dateObj)". Is the '+' necessary?
In MDN, it says that this( new Date(dateObj) ) effectively makes a copy of the existing Date object with the same date and time.
So, is the '+' necessary?
I tried differernt params, both methods got the same result.
Beta Was this translation helpful? Give feedback.
All reactions