0 votes
in JavaScript by
What is the shortcut to get timestamp in Javascript?

1 Answer

0 votes
by

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());
...