JavaScript MCQ Test

JavaScript MCQ Test

Q1. What is the purpose of <noscript> tag in Java Script?

  1. Prevents scripts on the page from executing.
  2. Enclose text to be displayed by non –JavaScript browsers.
  3. Suppresses the result to be displayed on the web page.
  4. None of the above.

Right Answer: B

Q2. Java Script entities start with ___________and end with _____________

  1. Semicolon, colon
  2. Semicolon, Ampersand
  3. Ampersand, colon
  4. Ampersand, semicolon.

Right Answers: D

Q3. Which of the following is a server-side Java Script object?

  1. Function
  2. File
  3. FileUpload
  4. Date

Right Answer: B

Q4. Which of the following is a client-side Java Script object?

  1. Function
  2. File
  3. FileUpload
  4. Date

Right Answer: C

Q5. Which of the following is the correct way for writing Java Script array?

  1. var salaries = new Array(1:39438, 2:39839 3:83729)
  2. var salaries = new (Array1=39438, Array 2=39839 Array 3=83729)
  3. var salaries = new Array(39438, 39839,83729)
  4. var salaries = new Array() values = 39438, 39839 83729

Right Answer: C

Q6. File is server-side JavaScript object

  1. True
  2. False

Right Answer: B

Q7. Which of the following syntax is correct to refer an external script called “formValidation.js”?

  1. <script href = “formValidation.js”>
  2. <script source = “formValidation.js”>
  3. <script name = “formValidation.js”>
  4. <script src = “formValidation.js”>

Right Answers: D

Q8. JavaScript supports all boolean operators

  1. True
  2. False

Right Answer: B

Q9. What is the alternate name for Java script?

  1. LimeScript
  2. Both a and d
  3. ECMScript
  4. ECMAScript

Right Answer: D

Q10. What type of image map could be used with Java Script?

  1. Client-side image maps
  2. Server-side image maps.
  3. Both A and B
  4. Localhost image maps

Right Answer: A

Q11. Is it possible to declare a variable in Java Script along its type?

  1. Yes
  2. No

Right Answer: A

Q12. Which of the following are capable of Java Script functions?

  1. Returning multiple values
  2. Accepting parameters and returning values
  3. Accepting parameters
  4. All choices are correct

Right Answer: C

Q13. Which of the following is not a valid JavaScript variable name?

  1. 2java
  2. _java_and_java_names
  3. Javaandjava
  4. None of the above

Right Answer: A

Q14. What java wrapper type is created when a JavaScript object is sent to Java?

  1. ScriptObject
  2. JavaObject
  3. Jobject
  4. JSObject

Right Answer: D

Q15. Which of the following is correct to write “Hello World ” on the web page?

  1. System.out.println(“Hello World”)
  2. print(“Hello World”)
  3. document.write(“Hello World”)
  4. response.write(“Hello World”)

Right Answer: C

Q16. How does Java Script store dates in objects of Date type?

  1. The number of days since 1st, 1900
  2. The number of seconds since January 1st, 1970
  3. The number of milliseconds since January 1st, 1970
  4. The number of picoseconds since January 1st, 1970

Right Answer: C

Q17. Java script can be used for Storing the form’s content to a database file on the server.

  1. False
  2. True

Right Answer: A

Q18. Which attribute needs to be changed to make elements invisible?

  1. Visibility
  2. Visible
  3. Invisibility
  4. Invisible

Right Answer: A

Q19. Which machine actually executed the Java Script?

  1. The web server
  2. The machine which is running a web server.
  3. Java Script engine
  4. Both A and C

Right Answer: B

Q20. Which attribute is used to hold the Java Script Version?

  1. SCRIPT
  2. VERSION
  3. LANGUAGE
  4. VER

Right Answer: C

 

Advertisements

Please Login to Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s