Functions Flashcards

1
Q

Do functions need brackets if they have two parameters in a body arrow function?

A

Yes.

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

Do functions need brackets if they have one parameter in a body arrow function?

A

No.

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

What is the purpose of a parameter?

A

To allow a function to pass data

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

Is the purpose of a parameter to specify actual values passed to a function?

A

No, it allows a function to pass data.

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

What is wrong with this code?
const greeting = => {
console.log(‘Hello Programmer!’);
};

A

Arrow functions need a parenthesis placeholder to “function” in the absence of parameters.

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

What kind of function is this?

function volumeOfCube (side) {
  return side * side * side;
}
volumeOfCube(5);
// Output: 125.
A

A function declaration.

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

Consise body syntax operators?

A

= =>

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