There will be times with JavaScript when you need to get a timestamp to track when something happened or how long something took.
We have two options:
The class/static/prototype method Date.now( )
or the instance method mydate.valueOf( )
Both return a timestamp but it is important to understand the differences between them.
One other alternative that I did not mention in the video is that you can use the + unary operator to convert a Date into a timestamp.
let timestamp3 = +new Date( );
let today = new Date( );
let timestamp4 = +today;