How can I get a timestamp in JavaScript?
Something similar to Unix timestamp, that is, a single number that represents the current time and date. Either as a number
You can only use
var timestamp = new Date().getTime(); console.log(timestamp);
to get the current timestamp. No need to do anything extra.