Question 2
Consider the JavaScript Code :
Answer : (4) M=2; D1 displays ”12”; D2 displays ”6”.
Consider the JavaScript Code :
var y = "12" ;
function f( ) {
var y = "6" ;
alert (this.y) ;
function g( ) { alert (y) ; }
g( );
}
f( );
If M is the number of alert dialog boxes generated by this JavaScript code and D1, D2, ....,DM
represents the content displayed in each of the M dialog boxes, then :Answer : (4) M=2; D1 displays ”12”; D2 displays ”6”.
Explanation Question 2
The JavaScript this keyword is used within any function scope or the global scope, and in each scope it receives a different value. The value of this inside a function, effectively depends on the object which called it.
The JavaScript this keyword is used within any function scope or the global scope, and in each scope it receives a different value. The value of this inside a function, effectively depends on the object which called it.
Previous | Next |
UGC NET CS 2018 July - II Question 1 | UGC NET CS 2018 July - II Question 3 |
Nice blog!
ReplyDeleteCompetition Guru is best UGC NET Coaching in Chandigarh. There are 2 papers in the UGC NET exam for both JRF and AF posts.
Thank you for sharing this. It's an amazing blog. We provide the bestUGC NET Coaching in Chandigarh and get trained from expert faculty.
ReplyDelete