Monday, June 3, 2013

JavaScript MCQ Test - 2

Que.1. Which of the following statements are false for Java Script?
A.    Variables names are not case sensitive.
B.    Variable names must begin with a letter or the underscore character.
C.    Var is used to declare a variable.
D.    Both b and c above.

Right Answer: A

Que.2. To insert a JavaScript into an HTML page, which tag is used?
A.    <script=’java’>
B.    <javascript>
C.    <script>
D.    <js>

Right Answer: C

Que.3. Javascript is an object oriented language?
A.    False
B.    True

Right Answer: B

Que.4. What language defines the behavior of a web page?
A.    HTML
B.    CSS
C.    XML
D.    Java Script

Right Answer: D

Que.5. Which of the ways below is incorrect of installing a date?
A.    new Date(dateString)
B.    new Date()
C.    new Date(seconds)
D.    new Date(year, month, day, hours, minutes, seconds, milliseconds)

Right Answer: C

Que.6. C-style block-level scoping is not supported in Java script
A.    False
B.    True

Right Answer: B

Que.7. Which of the following statements are true for Java script?
A.    JavaScript is case sensitive.
B.    JavaScript statements can be grouped together in blocks.
C.    semicolon at the end of statements is mendetory.
D.    Both a and b above.

Right Answer: D

Que.8. Which of the following is the tainted property of a window object in Java Script?
A.    Pathname
B.    Protocol
C.    Defaultstatus
D.    Host

Right Answer: C

Que.9. JavaScript ignores extra spaces.
A.    True
B.    False

Right Answer: A

Que.10. If we don’t want the script to write page content, under which HTML tag should the JS tag be placed?
A.    <body>
B.    <head>
C.    Any of a and b above
D.    Both b and c above.

Right Answer: A

Que.11. Why so Java and Java Script have similar name?
A.    Java Script is a stripped – down version of Java.
B.    The syntax of JavaScript is loosely based on Java syntax.
C.    They both support Object Oriented Programming.
D.    None of the above.

Right Answer: B

Que.12. Which of the following method is used to evaluate a string of Java Script code in the context of the specified object?
A.    Eval
B.    ParseDouble
C.    ParseObject
D.    Eflot

Right Answer: A

Que.13. Which is the correct way to write a JavaScript array?
A.    var txt = new Array(1:”arr”,2:”kim”,3:”jim”)
B.    var txt = new Array:1=(“arr”)2=(“kim”)3=(“jim”)
C.    var txt = new Array(“arr”,”kim”,”jim”)
D.    var txt = new Array=” arr ”,”kim”,”jim”
Right Answer: C

Que.14. What is negative infinity in Java script?
A.    Any of the below.
B.    number in JavaScript, derived by dividing number by negative number.
C.    number in JavaScript, derived by dividing number by zero.
D.    number in JavaScript, derived by dividing negative number by zero.

Right Answer: A

Que.15. Which of the following is not a valid JavaScript variable name?
A.    2java
B.    _java_and_java_names
C.    Javaandjava
D.    None of the above.

Right Answer: A

Que.16. ___________ JavaScript is also called client-side JavaScript.
A.    Microsoft
B.    Navigator
C.    LiveWire
D.    Native

Right Answer: B

Que.17. How to append a value to an array of Java Script?
A.    arr[arr.lenght] = value
B.    arr[arr.lenght+1] = new Arrays()
C.    arr[arr.lenght-1] = value
D.    arr[arr.lenght*1] = value

Right Answer: A

Que.18. Java script can be used for Storing the form’s content to a database file on the server.
A.    False
B.    True.

Right Answer: A

Que.19. Which of the following is used to capture all click events in window?
A.    window.captureEvents(Event.CLICK);
B.    window.routeEvents(Event.CLICK);
C.    window.handleEvents(Event.CLICK);
D.    window.raiseEvents(Event.CLICK);

Right Answer: A

Que.20. What is the event that fires when the form elements: <button>.<textarea> loses the focus?
A.    Onclick
B.    Ondblclick
C.    Onfocus
D.    Onblur

Right Answer: D

No comments:

Post a Comment