Home / Programming MCQs / JavaScript MCQs / Question
D
Q. Which of the following is the correct output for the following JavaScript code:
varx=5,y=1 var obj ={ x:10} with(obj) { alert(y) }
The output of the above snippet code will be one because, first of all, the interpreter will search "obj" for the property (y). But it fails to find "obj" for property "y," so it chooses a value from outside the object, which is available within the given code.
You must be Logged in to update hint/solution
Which of the following is a JavaScript data type?
The JavaScript’s syntax calling ( or executing ) a function or method is called
Do functions in JavaScript necessarily return a value ?
Which API makes the user’s current location available to browser-based application?
Which is the method invoked to begin a path?
What will be the output of the following JavaScript code?
Which one of the following is correct output for the following given JavaScript code
Find output of below Javascript addition code
Discusssion
Login to discuss.