Javascript-Functions Flashcards

1
Q

What is a function in JavaScript?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the parts of a function definition.

A
  1. Function key wor
  2. optional function name
  3. parameters which are also optional
  4. function code block
  5. return statement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the parts of a function call.

A

First you have the function name followed by parentheses that can be filled with arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the parts of a function call.

A

First you have the function name followed by parentheses that can be filled with arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When comparing them side-by-side, what are the differences between a function call and a function definition?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly