javascript-tutorial / javascript-tutorial/en.javascript.info
Clarify Explanation of Function Expressions in JavaScript Tutorial
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 25.5k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
Description
Description: The section of the tutorial discussing function expressions could benefit from a clearer distinction between Function Declarations and Function Expressions. Currently, the wording may cause confusion by implying that a Function Declaration creates a "variable" to hold the function name, which isn’t technically accurate.
Suggested Changes: In the tutorial, this line:
"The Function Declaration (1) creates the function and puts it into the variable named sayHi."
Might be more accurately phrased as:
"The Function Declaration (1) creates a function with the name sayHi. Unlike a Function Expression, this doesn’t involve a variable assignment."
This change would help learners understand that sayHi in this example is the function’s name from the declaration, rather than a variable containing the function reference.
Additional Context: I initially misunderstood this as creating a variable. I believe this clarification would prevent similar confusion for others. Thanks for considering this suggestion!
See screenshot attached
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the JavaScript tutorial section on function expressions and locate the quoted sentence comparing Function Declarations with variable assignment. Update the wording to distinguish a declaration's function name from a Function Expression's variable assignment, then check the rendered tutorial for clarity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100