File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -955,18 +955,16 @@ Other Style Guides
955955 >
956956 > **Prefer traditional functions when:**
957957 >
958- > - You rely on **function hoisting**, such as calling a function before its definition .
958+ > - You are defining top-level, reusable functions rather than inline callbacks .
959959 > - You need a **dynamic `this` binding**, for example in object methods or DOM event handlers.
960960 > - You require access to the **`arguments` object**, which is not available in arrow functions.
961961 >
962962 > **Examples:**
963963 >
964964 > ```js
965- > // Function hoisting
966- > initialize();
967- >
968- > function initialize() {
969- > // setup logic
965+ > // Named function for reuse and clearer stack traces
966+ > function formatUserName(user) {
967+ > return ` ${ user .firstName } ${ user .lastName } ` ;
970968 > }
971969 > ` ` `
972970 >
You can’t perform that action at this time.
0 commit comments