Wednesday, May 15, 2013

JavaScript MCQ Test - 1

Que.1. What is the purpose of <noscript> tag in Java Script?
A.    Prevents scripts on the page from executing.
B.     Enclose text to be displayed by non –JavaScript browsers.
C.    Suppresses the result to be displayed on the web page.
D.    None of the above.
Right Answer: B
Que.2. Java Script entities start with ___________and end with _____________
A.    Semicolon, colon
B.     Semicolon, Ampersand
C.    Ampersand, colon
D.    Ampersand, semicolon.
Right Answers: D
Que.3. Which of the following is a server-side Java Script object?
A.    Function
B.     File
C.    FileUpload
D.    Date
Right Answer: B
Que.4. Which of the following is a client-side Java Script object?
A.    Function
B.     File
C.    FileUpload
D.    Date
Right Answer: C
Que.5. Which of the following is the correct way for writing Java Script array?
A.    var  salaries = new Array(1:39438, 2:39839 3:83729)
B.     var  salaries = new (Array1=39438, Array 2=39839 Array 3=83729)
C.    var  salaries = new Array(39438, 39839,83729)
D.    var  salaries = new Array() values = 39438, 39839 83729
Right Answer: C
Que.6. File is server-side JavaScript object
A.    True
B.     False
Right Answer: B
Que.7. Which of the following syntax is correct to refer an external script called “formValidation.js”?
A.    <script href = “formValidation.js”>
B.     <script source = “formValidation.js”>
C.    <script name = “formValidation.js”>
D.    <script src = “formValidation.js”>
Right Answers: D
Que.8. JavaScript supports all boolean operators
A.    True
B.     False
Right Answer: B
Que.9. What is the alternate name for Java script?
A.    LimeScript
B.     Both a and d
C.    ECMScript
D.    ECMAScript
Right Answer: D
Que.10. What type of image map could be used with Java Script?
A.    Client-side image maps
B.     Server-side image maps.
C.    Both A and B
D.    Localhost image maps
Right Answer: A
Que.11. Is it possible to declare a variable in Java Script along its type?
A.    Yes
B.     No
Right Answer: A
Que.12. Which of the following are capable of Java Script functions?
A.    Returning multiple values
B.     Accepting parameters and returning values
C.    Accepting parameters
D.    All choices are correct
Right Answer: C
Que.13. 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.14. What java wrapper type is created when a JavaScript object is sent to Java?
A.    ScriptObject
B.     JavaObject
C.    Jobject
D.    JSObject
Right Answer: D
Que.15. Which of the following is correct to write “Hello World ” on the web page?
A.    System.out.println(“Hello World”)
B.     print(“Hello World”)
C.    document.write(“Hello World”)
D.    response.write(“Hello World”)
Right Answer: C
Que.16. How does Java Script store dates in objects of Date type?
A.    The number of  days since 1st, 1900
B.     The number of  seconds since January 1st, 1970
C.    The number of  milliseconds since January 1st, 1970
D.    The number of  picoseconds since January 1st, 1970
Right Answer: C
Que.17. 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.18. Which attribute needs to be changed to make elements invisible?
A. Visibility
B.  Visible
C. Invisibility
D. Invisible
Right Answer: A
Que.19. Which machine actually executed the Java Script?
A.    The web server
B.     The machine which is running a web server.
C.    Java Script engine
D.    Both A and C
Right Answer: B
Que.20. Which attribute is used to hold the Java Script Version?
A.    SCRIPT
B.     VERSION
C.    LANGUAGE
D.    VER
Right Answer: C