Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Aptitude | JavaScript Course Quiz 3 | Question 9

  • Last Updated : 10 May, 2019

What will be the output of the following code?

document.write(Number('1') - 1 == 0);

(A) true
(B) false
(C) 1
(D) None of the above

Answer: (A)

Explanation: You’re casting the string 1 as a number, and subtracting it from the number 1. This equals 0.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :