1.

What is the Boolean value of “” in JavaScript?(a) true(b) on(c) off(d) falseThis question was addressed to me in an online interview.Asked question is from Essential JavaScript and jQuery in section HTML Tables, Javascript & Jquery Basics of HTML

Answer»

Correct ANSWER is (d) false

Best explanation: For an empty STRING (“”), the Boolean value is false. E.g. var t= “ ”; Boolean(t); //it will return false. For -0(MINUS ZERO), the Boolean value is false. The Boolean value of undefined is also false. For null and false the Boolean value is also false.



Discussion

No Comment Found

Related InterviewSolutions