There are different ways to get the current time in milliseconds with a Date object:
(new Date()).getTime(); +new Date(); Date.now();
Assuming you don't need to create an object and just need the current time in milliseconds, which would be the most efficient? In terms of performance.
EDIT: I understand that most developers don't care about this, but it can make a difference when you work in a low-tech embedded environment or just kill curiosity.
performance javascript date
Sherzod
source share