Changed ‘anotherFunctions’ to ‘anotherFunction’
Also separated ‘everytime’
This commit is contained in:
parent
23b5766b82
commit
3060be8505
1 changed files with 1 additions and 1 deletions
|
@ -205,7 +205,7 @@ function showMessage(from, text = anotherFunction()) {
|
||||||
```
|
```
|
||||||
|
|
||||||
```smart header="Evaluation of default parameters"
|
```smart header="Evaluation of default parameters"
|
||||||
In JavaScript, a default parameter is evaluated every time the function is called without the respective parameter. In the example above, `anotherFunctions()` is called everytime `someMessage()` is called without the `text` parameter. This is in contrast to some other languages like Python, where any default parameters are evaluated only once during the initial interpretation.
|
In JavaScript, a default parameter is evaluated every time the function is called without the respective parameter. In the example above, `anotherFunction()` is called every time `someMessage()` is called without the `text` parameter. This is in contrast to some other languages like Python, where any default parameters are evaluated only once during the initial interpretation.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue