Single Choice
Easy
QWhat is the result of the following code?
function foo() {}
console.log(foo instanceof Function);
ID: #4892
JavaScript Operator MCQ
176 views
Question Info
#4892Q ID
EasyDifficulty
JavaScript Operator MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
The instanceof operator in JavaScript is used to determine whether an object is an instance of a particular constructor or class. In this case, the variable foo has been assigned a function. The instanceof operator is called on foo, with Function as the right operand. Since foo is an instance of the Function constructor, the instanceof operator will return true.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic