question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule proposal: `prefer-date-now`

See original GitHub issue

Prefer Date.now() over new Date().getTime().

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now

Because Date.now() is shorter and nicer.

Fail

new Date().getTime();

Pass

Date.now();

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
fiskercommented, Dec 10, 2020
BigInt(new Date())

Or any arithmetic operation on it?

+ can’t

1reaction
sindresorhuscommented, Nov 28, 2020

@papb 👍🏻

Read more comments on GitHub >

github_iconTop Results From Across the Web

SEC Proposed Rules
SEC Proposed Rules · Regulation NMS: Minimum Pricing Increments, Access Fees, and Transparency of Better Priced Orders · File No: S7-30-22 · Comments...
Read more >
The Most Curious Rule Proposal in Securities and Exchange ...
The Proposed Rules are of three categories: Disclosure Rules, Audit Rules, and Prohibited Activity Rules. These comments relate solely to the ...
Read more >
SEC's Proposed Preferential Treatment Rule: Does the Side ...
By Jennifer Kalmanides. On February 9, 2022, the Securities and Exchange Commission (the “SEC”) unveiled a slate of newly proposed rules, ...
Read more >
sindresorhus/eslint-plugin-unicorn (Raised $2856.00)
Rule proposal: No default parameter options ... Rule proposal: Don't import `util` Node.js core module directly ... Rule proposal: `prefer-date-now`.
Read more >
SEC Revisits Shareholder Proposal Rule | WilmerHale
... amendments to the proxy rules governing proxy voting advice and (b) proposing amendments to the shareholder proposal rule in Rule 14a-8.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found