adplus-dvertising
frame-decoration

Question

Consider the JavaScript Code. 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:
var y= “12”;
function f( ) {
var y = “6”;
alert (this.y);
function g( ) {alert (y); }
g( );
}
f( );

a.

M=3; D1 displays “12”; D2 displays “6”; D3 displays “12”.

b.

M=3; D1 displays “6”; D2 displays “12”; D3 displays “6”.

c.

M=2; D1 displays “6”; D2 displays “12”.

d.

M=2; D1 displays “12”; D2 displays “6”.

Answer: (d).M=2; D1 displays “12”; D2 displays “6”.

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Consider the JavaScript Code. 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...

Similar Questions

Discover Related MCQs

Q. In Java, which of the following statements is/are True?

S1: The ‘final’ keyword applied to a class definition prevents the class from being extended through derivation.
S2: A class can only inherit one class but can implement multiple interfaces.
S3: Java permits a class to replace the implementation of a method that it has inherited. It is called method overloading.

Q. An XML document that adheres to syntax rules specified by XML 1.0 specification in that it must satisfy both physical and logical structured, is called :

Q. Which of the following statement(s) is/are TRUE regarding Java Servelets?

(a) A Java Servelet is a server-side component that runs on the web server and extends the capabilities of a server.
(b) A Servelet can use the user interface classes like AWT or Swing.

Q. Which of the following statements is/are TRUE?

(a) In HTML, character entities are used to incorporate external content into a web page, such as images.
(b) Once a web server returns a cookie to a browser, the cookie will be included in all future requests from the browser to the same server.

Q. Which of the following statements is/are TRUE regarding JAVA?

(a) Constants that cannot be changed are declared using the ‘static’ keyword.
(b) A class can only inherit one class but can implement multiple interfaces.

Q. What is the full form of WWW?

Q. What is the full form of Email?

Q. What is the full form of FTP?

Q. What is the full form of LAN?

Q. ISP is an acronym of

Q. Which of the following layers of the TCP/IP references model routes packets?

Q. Networks of computers connected over greater distances are called

Q. Which of the following is not a layer in the TCP/IP reference model?

Q. How many bits are their in an IP address?

Q. Rules contained in programs on router computers that determine the best path on which to send packets are called

Q. What is the top-level domain in www.yahoo.com/sports

Q. Which of the following protocols is used to send and receive emails?

Q. Which of the following protocols is used to transfer files over a network?

Q. Which of the following is a transport layer protocol in the TCP/IP protocol suite?

Q. Which of the following is used to retrieve mails from remote mail server?