Skip to content

Modern JS: don't use var in css-examples #163

Open
@teoli2003

Description

@teoli2003

Quite a few examples in this repo extensively use var.

This is a bad practice; we have eliminated them from mdn/content (and other repos). We should do the same here: most will be simply replaced by const and let, although there may be a few more complex cases (where var is used inside a scope for a variable at a higher scope)

Activity

added
help wantedIf you know something about this, we would love your help!
good first issueA good issue for newcomers to get started with.
choreA routine task.
on Dec 7, 2023
pragyamishra56

pragyamishra56 commented on Jan 5, 2024

@pragyamishra56

@teoli2003 Sir If it possible to allow me to fix this issue ?

teoli2003

teoli2003 commented on Jan 5, 2024

@teoli2003
ContributorAuthor

Just go ahead; it is yours. Don't create too big PRs, they take longer to review.

pragyamishra56

pragyamishra56 commented on Jan 6, 2024

@pragyamishra56

@teoli2003 Sir Thanks for pointing this out! I completely agree with eliminating the use of 'var'. It's considered a best practice to use 'const' and 'let' for better scope management. I'll work on addressing this across the repository, replacing 'var' with the appropriate declarations. Your input is highly appreciated!

pragyamishra56

pragyamishra56 commented on Jan 8, 2024

@pragyamishra56

@teoli2003 Sir, Replace extensive var usage with const/let, aligning with the best So, should I replace 'var' with 'const/let'?

teoli2003

teoli2003 commented on Jan 8, 2024

@teoli2003
ContributorAuthor

Yes.

pragyamishra56

pragyamishra56 commented on Jan 8, 2024

@pragyamishra56

@teoli2003 Sir, Could you confirm that In every JS file, I will replace the var with const/let?

teoli2003

teoli2003 commented on Jan 8, 2024

@teoli2003
ContributorAuthor

With the relevant one, yes. If you are not sure, start with one file.

pragyamishra56

pragyamishra56 commented on Jan 10, 2024

@pragyamishra56

@teoli2003 Sir, Issue #163 is resolved now could you please have a look at it if any issue is raised then let me know

teoli2003

teoli2003 commented on Jan 10, 2024

@teoli2003
ContributorAuthor

You need to open a pull request.

pragyamishra56

pragyamishra56 commented on Jan 10, 2024

@pragyamishra56

@teoli2003 Sir I opened a pull request could you review it if any further issue is raised then let me know

8 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreA routine task.effort: mediumTask is a medium effort.good first issueA good issue for newcomers to get started with.help wantedIf you know something about this, we would love your help!idleIssues and pull requests with no activity for three months.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Modern JS: don't use `var` in css-examples · Issue #163 · mdn/css-examples