Javascript-Functions Flashcards
What is a function in JavaScript?
A function in JavaScript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output
Describe the parts of a function definition.
- Function key wor
- optional function name
- parameters which are also optional
- function code block
- return statement
Describe the parts of a function call.
First you have the function name followed by parentheses that can be filled with arguments
Describe the parts of a function call.
First you have the function name followed by parentheses that can be filled with arguments
When comparing them side-by-side, what are the differences between a function call and a function definition?