-
This has come up as part of the project to modernize our use of JS in the Learning Area (mdn/content#10337). In these docs we have almost totally removed usages of const para = document.querySelector('p');
para.addEventListener('click', updateName);
function updateName() {
let name = prompt('Enter a new name');
para.textContent = 'Player 1: ' + name;
} Here, I like the guideline that says "use This is the guideline we follow (and enforce using ESLint) in interactive-examples. But if we don't want to follow this guideline, what guideline do we want? Or should I just not touch these in the course of this project? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
@wbamberg IMO your guideline should be added to the docs and followed. We can't expect people to use Further, I think we'd like to consider ultimately also running eslint over our examples as well as prettier. |
Beta Was this translation helpful? Give feedback.
-
I'm supportive of following "use |
Beta Was this translation helpful? Give feedback.
-
I'm closing this, since everyone seems to agree that we should follow the rule "use const when you can and let when you have to" (and eventually enforce it with ESLint). |
Beta Was this translation helpful? Give feedback.
-
Closing as answered/settled. |
Beta Was this translation helpful? Give feedback.
I'm closing this, since everyone seems to agree that we should follow the rule "use const when you can and let when you have to" (and eventually enforce it with ESLint).