Functions Flashcards

1
Q

Basic Function Declaration

A
function functionName(parameter) {
     //do stuff;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Calling a function

A

functionName(argument);

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

Function Expression

A
const functionName = function(parameterOne, parameterTwo) {
     //do stuff;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fat Arrow Function

A
const functionName = (parameterOne, parameterTwo) => {
     //do stuff;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Default Parameter

A
function functionName (default = 'This is the default') {
     //do stuff;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Concise Body Function, Zero Parameters

A
const functionName = () => {};
-Parentheses required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Concise Body Function, One Parameter

A
const functionName = parameterOne => {};
-No parentheses required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Concise Body Function, Two or more Parameters

A
const functionName = (parameterOne, parameterTwo) => {};
-Parentheses required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Concise Body Function, Single Line Block

A
const functionName = parameter => parameter + 2;
-No curly braces required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Concise Body Function,

Multi-line Block

A
const functionName = parameter => {
     const sum = parameter + 2;
     return sum;
}
-Curly braces required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly