javascript-functions Flashcards

1
Q

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

A
function definition gets the word function and code block.
function call does not get the word function and no code block
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between a parameter and an argument?

s

A

parameter as a placeholder.

when we define a function, we declare parameters and that when we call a function, we pass it argument

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

Why are function parameters useful?

A

They serve as placeholder

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

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

A

Causes the function to produce a value we can use in our program.
Prevents any more code in the function’s code block from being run.

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