FrontendDeveloper.in

JavaScript Track Detail

What is the shortcut to get timestamp

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

console.log(+new Date());
console.log(Date.now());