mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-24 19:00:16 -04:00
fix: common practices for naming variables and functions multiple choice question (#57662)
Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5b89dec411
commit
a5f149647a
@@ -86,35 +86,35 @@ Remember the prefix we typically use for getter functions.
|
||||
|
||||
## --text--
|
||||
|
||||
Which of these is the best name for a constant representing the maximum number of login attempts?
|
||||
Which of the following should you do if you’re working in an established codebase and / or with a team?
|
||||
|
||||
## --answers--
|
||||
|
||||
`max_attempts`
|
||||
Use your text editor's find-and-replace feature to update any function or variable names you come across that could be improved, even it's not related to the task you're working on.
|
||||
|
||||
### --feedback--
|
||||
|
||||
Recall the convention for naming constants in JavaScript.
|
||||
Remember that this lecture covers some naming conventions, and each codebase could have its own established conventions.
|
||||
|
||||
---
|
||||
|
||||
`MAX_LOGIN_ATTEMPTS`
|
||||
Stick to the naming conventions for variables and functions that have already been established.
|
||||
|
||||
---
|
||||
|
||||
`loginMaxAttempts`
|
||||
Come up with your own naming conventions for any new code you write.
|
||||
|
||||
### --feedback--
|
||||
|
||||
Recall the convention for naming constants in JavaScript.
|
||||
Remember that this lecture covers some naming conventions, and each codebase could have its own established conventions.
|
||||
|
||||
---
|
||||
|
||||
`ATTEMPTS_MAX`
|
||||
Strictly use the naming conventions covered in this lecture.
|
||||
|
||||
### --feedback--
|
||||
|
||||
Recall the convention for naming constants in JavaScript.
|
||||
Remember that this lecture covers some naming conventions, and each codebase could have its own established conventions.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user