en.javascript.info icon indicating copy to clipboard operation
en.javascript.info copied to clipboard

Clarify Explanation of Function Expressions in JavaScript Tutorial

Open Skllkzm opened this issue 1 year ago • 0 comments

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 1

Skllkzm avatar Oct 29 '24 10:10 Skllkzm