Functions Flashcards
1
Q
Do functions need brackets if they have two parameters in a body arrow function?
A
Yes.
2
Q
Do functions need brackets if they have one parameter in a body arrow function?
A
No.
3
Q
What is the purpose of a parameter?
A
To allow a function to pass data
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.
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.
6
Q
What kind of function is this?
function volumeOfCube (side) { return side * side * side; }
volumeOfCube(5); // Output: 125.
A
A function declaration.
7
Q
Consise body syntax operators?
A
= =>