Back to the 2024 paper

Module III — Basics of Web Programming

20242m

In JavaScript, what is the result of the following expression: typeof null? (i) null (ii) object (iii) undefined (iv) boolean

Worked SolutionAI Assisted

Answer: (ii) object

typeof null returns "object". This is a long-standing bug from the first version of JavaScript, where null was represented with the object type tag, and it was kept for backward compatibility. To test for null, use value === null.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.