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

Rename currentWeapon variable to currentWeaponIndex #54777

Closed
ElectricCowBoy123 opened this issue May 14, 2024 · 2 comments · Fixed by #54787
Closed

Rename currentWeapon variable to currentWeaponIndex #54777

ElectricCowBoy123 opened this issue May 14, 2024 · 2 comments · Fixed by #54787
Labels
help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.

Comments

@ElectricCowBoy123
Copy link

Describe the Issue

The currentWeapon variable could be better called currentWeaponIndex reflecting that it is a variable that is to be used to index the array weapons

Proposal

Rename all instances of currentWeapon to currentWeaponIndex to make it clearer in the examples

Affected Page

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/

Your code


N/A

Expected behavior

N/A

Screenshots

No response

System

  • Device: [e.g. iPhone 6, Laptop]
  • OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]

Additional context

No response

@ElectricCowBoy123 ElectricCowBoy123 added scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc. labels May 14, 2024
@jdwilkin4
Copy link
Contributor

Rename all instances of currentWeapon to currentWeaponIndex

I like the new name change but it shouldn't be all instances.
It should be most instances.

The only time it shouldn't change is when currentWeapon is declared in this new scope here

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-105

So currentWeapon makes sense there

@jdwilkin4 jdwilkin4 added help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum and removed status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. labels May 14, 2024
@ElectricCowBoy123
Copy link
Author

The only time it shouldn't change is when currentWeapon is declared in this new scope here

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-105

So currentWeapon makes sense there

Ah, yes indeed missed that one, I agree!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants