javascript-functions Flashcards

1
Q

What is a function in JavaScript?

A

Series of steps that perform an action when called

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

Function keyword, name, parameters, arguments, and code block

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

I don’t know

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

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

A

Definition just defines it and a call actually produces results
When a function is called, the parameters in its definition take on the values of the arguments that were passed.

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

What is the difference between a parameter and an argument?

A

A parameter is just a placeholder for input values and arguments are actual input values.

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

Why are function parameters useful?

A

I don’t know

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

What two effects does a return statement have on the behavior of a function?

A

Stops code.

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