Javascript Functions Flashcards
1
Q
What are the five parts of a function definition?
A
- The function keyword
- The name of the function
- A list of parameters, enclosed in parentheses and separated by commas.
- Javascript statements that define the function. Enclosed in curly braces.
- Return statement.
2
Q
How do you call a function?
A
You can call a function with the function name and argument.
3
Q
What is the difference between a parameter and an argument?
A
- Function parameters are the names listed in the function’s definition.
- Function arguments are the values passed to functions when it is invoked.