change wording: "brackets" to "parentheses"
This commit is contained in:
parent
38e1bb5c52
commit
07550ef0ee
1 changed files with 3 additions and 3 deletions
|
@ -491,7 +491,7 @@ function() { // <-- JavaScript cannot find function name, meets ( and gives erro
|
||||||
We can say "okay, let it be so Function Declaration, let's add a name", but it won't work. JavaScript does not allow Function Declarations to be called immediately:
|
We can say "okay, let it be so Function Declaration, let's add a name", but it won't work. JavaScript does not allow Function Declarations to be called immediately:
|
||||||
|
|
||||||
```js run
|
```js run
|
||||||
// syntax error because of brackets below
|
// syntax error because of parentheses below
|
||||||
function go() {
|
function go() {
|
||||||
|
|
||||||
}(); // <-- can't call Function Declaration immediately
|
}(); // <-- can't call Function Declaration immediately
|
||||||
|
@ -505,11 +505,11 @@ There are other ways to tell JavaScript that we mean Function Expression:
|
||||||
// Ways to create IIFE
|
// Ways to create IIFE
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
alert("Brackets around the function");
|
alert("Parentheses around the function");
|
||||||
}*!*)*/!*();
|
}*!*)*/!*();
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
alert("Brackets around the whole thing");
|
alert("Parentheses around the whole thing");
|
||||||
}()*!*)*/!*;
|
}()*!*)*/!*;
|
||||||
|
|
||||||
*!*!*/!*function() {
|
*!*!*/!*function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue