Content-Length: 1001 | pFad | http://github.com/javascript-tutorial/en.javascript.info/pull/3930.diff

thub.com diff --git a/1-js/02-first-steps/15-function-basics/article.md b/1-js/02-first-steps/15-function-basics/article.md index 415fed3e0a..71d164a4c7 100644 --- a/1-js/02-first-steps/15-function-basics/article.md +++ b/1-js/02-first-steps/15-function-basics/article.md @@ -523,6 +523,9 @@ function name(parameters, delimited, by, comma) { ``` - Values passed to a function as parameters are copied to its local variables. +- If a function is called, but an argument is not provided, then the value of the respective parameter becomes undefined. +- To assign such parameter a default value instead, specify it using "=" in the parameter list during function declaration. +- Any expression can be used as a default value for a parameter — including function calls. - A function may access outer variables. But it works only from inside out. The code outside of the function doesn't see its local variables. - A function can return a value. If it doesn't, then its result is `undefined`.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/javascript-tutorial/en.javascript.info/pull/3930.diff

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy