Two methods for JS to get the current timestamp

1. Brief description

Friends who often use vue and react know that many times we need to use the current timestamp as the id of the list; of course, it is also possible to get it usually; bloggers often use it and often forget it.

2. JS gets the current timestamp
2.1 Date.now()
Date.now()

The simplest and most effective

2.2 new Date().getTime()
new Date().getTime()

Guess you like

Origin blog.csdn.net/qq_41800366/article/details/107416747