+new Date() - Is this good practice?

前端 未结 5 1239
一整个雨季
一整个雨季 2020-12-12 22:37

So we had the Discussion today in our company about +new Date() being good practice or not. Some prefer this way over new Date().getTime().

5条回答
  •  情书的邮戳
    2020-12-12 22:48

    After thinking about this the last years a lot I came to the conclusion that performance is not a factor here.

    So here is the solution I prefer in terms of readability:

    Date.now();

提交回复
热议问题