17.
What is the purpose of the name property of a function in JavaScript?
To store the function's execution context.
To store the name of the function.
To store the number of parameters of the function.
To store the function's return value.
Correct: B
The name property of a JavaScript function returns the name of the function as a string. It can be used to access the function's name programmatically or for debugging purposes.
function myFunction() {
// ...
}
const functionName = myFunction.name;
console.log(functionName); // Output: "myFunction"