So, I noticed that the result
(new Date())
- Date object; in this case
Date {Thu Dec 04 2014 22:43:07 GMT+0200 (SAST)}
but if I print
+(new Date())
I get an int value;
1417725787989
How it's done?
I have a function called "Duration", which when used as follows:
new Duration(352510921)
returns an instance that looks like this:
{ days:5, hours:3, mins:55, secs:10, ms:921 }
So, how can I use the + operator to get the int value of the Duration instance?
var dur = new Duration(352510921);
console.log(+dur)
source
share