You can use new Date().getTime() to get the current timestamp. There is an alternative shortcut to get the value.
new Date().getTime()
console.log(+new Date()); console.log(Date.now());