- A Function prototype
- B Function literal
- C Function calling
- D Function declaration
- Share this MCQ
Answer:
B
Share this MCQ
A function definition expression, also known as a function literal, is a way to define a function in JavaScript.
It consists of the function keyword, followed by a list of parameters inside parentheses,
and a block of code inside curly braces that defines the function's behavior.
Here's an example of a function definition expression:
let greet = function(name) {
console.log('Hello, ' + name);
};
This function definition expression defines a function called greet that takes a single parameter called name and logs a greeting to the console.
Share this MCQ