Question
1.
2.
3.
4.
Answer (Detailed Solution Below)
Option 4 : undefined / अपरिभाषित
Advertisement
Detailed Solution
सही उत्तर undefined / अपरिभाषित है।
Key Points
Helpful?
Question:
What is printed by the code: console.log(x); var x = 5; / कोड से क्या छपेगा: console.log(x); var x = 5;
1.
5 / 5
2.
ReferenceError: x is not defined / ReferenceError: x परिभाषित नहीं है
3.
null / null
4.
undefined / अपरिभाषित
Correct Answer: undefined / अपरिभाषित
var declarations are hoisted and initialised to undefined, so x exists but holds no value yet when the log statement runs. / var घोषणाएँ ऊपर उठती हैं और undefined से प्रारंभ होती हैं, अतः log कथन चलने पर x मौजूद है पर उसका कोई मान नहीं है।
Downloaded from PrepSnap (prepsnap.in)