You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2d482ed
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/16-function-expressions/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ sayHi(); // Hello // this still works too (why wouldn't it)
72
72
Here's what happens above in detail:
73
73
74
74
1. The Function Declaration `(1)` creates the function and puts it into the variable named `sayHi`.
75
-
2. Line `(2)`copies it into the variable `func`. Please note again: there are no parentheses after `sayHi`. If there were, then `func = sayHi()` would write *the result of the call*`sayHi()` into `func`, not *the function*`sayHi` itself.
75
+
2. Line `(2)`makes the same function available through the variable `func`. Please note again: there are no parentheses after `sayHi`. If there were, then `func = sayHi()` would write *the result of the call*`sayHi()` into `func`, not *the function*`sayHi` itself.
76
76
3. Now the function can be called as both `sayHi()` and `func()`.
77
77
78
78
We could also have used a Function Expression to declare `sayHi`, in the first line:
0 commit comments