Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make string building code consistent #3179

Merged
merged 1 commit into from
Mar 18, 2021
Merged

Conversation

chrisdavidmills
Copy link
Contributor

Fixes #3158

Checklist — To help your pull request get merged faster, please do the following:

    • Provide a summary of your changes — say what problem you are fixing, what files are changed, and what you've done. This doesn't need to be hugely detailed, as we can see exact changes in the "Files changed" tab.
    • Provide a link to the issue(s) you are fixing, if appropriate, in the form "Fixes url-of-issue". GitHub will render this in the form "Fixes fix: fixable flaws in Glossary A-D entries #1234", with the issue number linked to the issue. Doing this allows us to figure out what issues you are fixing, as well as helping to automate things (for example the issue will be closed once the PR that fixed it has been merged).
    • Review the results of the automated checking we run on every PR and fix any problems reported (see the list of checks near the bottom of the PR page). If you need help, please ask in a comment!
    • Link to any other resources that you think might be useful in reviewing your PR.

@wbamberg
Copy link
Collaborator

Is there a reason to avoid template literals here? It's in our standard to prefer them: https://developer.mozilla.org/en-US/docs/MDN/Guidelines/Code_guidelines/JavaScript#use_template_literals.

@chrisdavidmills
Copy link
Contributor Author

Only really because it was quicker and easier to change one line rather than changing all instances in the article, plus the code examples that go with it ;-)

The learning area does need a massive overhaul at some point, to modernize all the JS we teach. At the moment, the strings article teaches old school concatenation at the forefront, but then mentions template literals as a mdoern option. We ought to just teach that by default.

But I've not got time for that at the moment.

@chrisdavidmills
Copy link
Contributor Author

In fact, I'll write an RFC about it.

@wbamberg
Copy link
Collaborator

In fact, I'll write an RFC about it.

Took the words right out of my mouth :)

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's merge this now then. Thanks, Chris!

@wbamberg wbamberg merged commit a3ce084 into main Mar 18, 2021
@wbamberg wbamberg deleted the chrisdavidmills-patch-1 branch March 18, 2021 18:11
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with "JavaScript basics": inconsistent usage of variables in functions
2 participants