1.

What is the return type of typeof for standard JavaScript objects?(a) xml(b) object(c) dom(d) htmlI got this question during an interview.Question is taken from Shorthand functions and Multiple catch clauses topic in section Classes and Modules in JavaScript of JavaScript

Answer»

Right option is (b) object

To explain I would say: The TYPEOF operator returns “object” for all standard JAVASCRIPT OBJECTS. It returns “object” for a null, “number” for NaN, “number” for Infinity, “object” for a “new Number(1)” and “object” for an array.



Discussion

No Comment Found

Related InterviewSolutions