Merge pull request #685 from aakanksha-02/patch-1

Update article.md
This commit is contained in:
Ilya Kantor 2018-12-24 12:47:45 +03:00 committed by GitHub
commit c06e2eaad4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,7 +205,8 @@ 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, `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.
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 `showMessage()` 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.
``` ```