Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Web technologies Questions | JavaScript Course Quiz 2 | Question 10

  • Last Updated : 18 Apr, 2019

What will be the output of the following code?




<script>
   var x = [typeof x, typeof y][1];
   document.write(typeof typeof x);
</script>

(A) undefined
(B) string
(C) number
(D) boolean


Answer: (B)

Explanation: typeof ‘y’ which is undefined returns ‘undefined’, typeof ‘undefined’ is ‘string’, and another typeof on it still returns ‘string’.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!