Skip to content

Commit

Permalink
Update arrow function documentation to clarify naming and assignment (#…
Browse files Browse the repository at this point in the history
…34501)

* Update arrow function documentation to clarify naming and assignment

* Update files/en-us/web/javascript/reference/functions/arrow_functions/index.md

---------

Co-authored-by: Joshua Chen <[email protected]>
  • Loading branch information
mathdebate09 and Josh-Cena authored Jun 29, 2024
1 parent f2426e7 commit 23013cf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The braces can only be omitted if the function directly returns an expression. I
};
```

Arrow functions are always unnamed. If the arrow function needs to call itself, use a named function expression instead. You can also assign the arrow function to a variable so it has a name.
Arrow functions are not inherently associated with a name. If the arrow function needs to call itself, use a named function expression instead. You can also assign the arrow function to a variable, allowing you to refer to it through that variable.

```js
// Traditional Function
Expand Down

0 comments on commit 23013cf

Please sign in to comment.