Parameters (Params). Flashcards
1
Q
What are Parameters?
A
A parameter is the variable listed inside the parentheses in the function declaration (it’s a declaration time term).
2.) When a value is passed as a function parameter, it’s also called an argument.
2
Q
What are Default values?
A
In JavaScript, a default parameter is evaluated every time the function is called without the respective parameter.
In the example above, anotherFunction() isn’t called at all, if the text parameter is provided.
On the other hand, it’s independently called every time when text is missing.