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.

Replace var with let or const as appropriate.

See original GitHub issue

I’m curious, what the stance is in terms of adopting let and const in this repo?

Possible approaches:

  • Consistently ES5 (var only)
  • Consistently ES6 (e.g. would a PR be welcome that converts all var to let & const?)
  • Allow internal inconsistency (mixed var, let, const within & between files)

This relates to how PRs should be reviewed with respect to usage of these keywords. Thanks!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
anlexNcommented, Aug 13, 2020

please rewrite d3 in es2015+ syntax

3reactions
mbostockcommented, Jun 25, 2020

It’s not a goal at this time to rewrite everything. We’re focused on getting 6.0 released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replacing let with const - Charles Stover - Medium
In JavaScript, const affords a few benefits: It lets the team reviewing your code that the value is not going to change, improving...
Read more >
Var, Let, and Const – What's the Difference? - freeCodeCamp
var declarations are globally scoped or function scoped while let and const are block scoped. var variables can be updated and re-declared ...
Read more >
Five things to know about var, let, and const in JavaScript
As a rule of thumb, always use const to declare your variables unless they are likely to change in the runtime of your...
Read more >
JavaScript: Var, Let, or Const? Which One Should you Use?
As a general rule, you should always declare variables with const, if you realize that the value of the variable needs to change,...
Read more >
Code Inspection: 'var' is used instead of 'let' or 'const' - JetBrains
Reports a var declaration that is used instead of let or const . Both let and const are block-scoped and behave more strictly....
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