Skip to content

Commit 2287075

Browse files
authored
prefer-date-now: Elaborate on rule rationale (#946)
1 parent 83a6453 commit 2287075

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/rules/prefer-date-now.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch
22

3-
[`Date.now()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) is shorter and nicer than [`new Date().getTime()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime).
3+
[`Date.now()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) is shorter and nicer than [`new Date().getTime()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime), and avoids unnecessary instantiation of `Date` objects.
44

55
This rule is fixable.
66

0 commit comments

Comments
 (0)