JS Coding Questions Logo
JS Coding Questions
#378💼 Interview💻 Code

What is the shortcut to get timestamp

Advertisement

728x90

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

javascript
1console.log(+new Date());
2
3console.log(Date.now());

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 36

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
378of476