JS-Functions Flashcards

1
Q

What is a function?

A

Holds code that we can reuse

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

Describe function defintion

A

function, functionName, (parameters if any) {

}

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

Describe parts of function call

A

functionName(arguments)

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

difference between parameter and argument

A

parameter is placeholder for when declaring a function

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

why are function parameters useful?

A

They are able to hold placeholder data that serve as blueprint for the function

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

what 2 effects does return statemtent have in functions

A

returns a value, stops code from running

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