Merge pull request #2423 from lumosmind/patch-56

parameters are also local variables
This commit is contained in:
Ilya Kantor 2021-01-10 15:51:26 +03:00 committed by GitHub
commit 468e355288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -273,7 +273,7 @@ We covered three ways to create a function in JavaScript:
``` ```
- Functions may have local variables: those declared inside its body. Such variables are only visible inside the function. - Functions may have local variables: those declared inside its body or its parameter list. Such variables are only visible inside the function.
- Parameters can have default values: `function sum(a = 1, b = 2) {...}`. - Parameters can have default values: `function sum(a = 1, b = 2) {...}`.
- Functions always return something. If there's no `return` statement, then the result is `undefined`. - Functions always return something. If there's no `return` statement, then the result is `undefined`.