20.
Which property of a JavaScript function returns the name of the function?
funcName
displayName
functionName
name
Correct: D
The name property of a JavaScript function returns the name of the function as a string. This property can be useful for debugging or when dynamically referencing functions within your code.
function myFunction() {
// ...
}
const functionName = myFunction.name;
console.log(functionName); // Output: "myFunction"