JavaScript MCQs – Multiple Choice Questions and Answers – Part 4

Multiple choice questions and answers (MCQs) on JavaScript to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are taken from an interview. So you will find questions on basic techniques such as variables, functions, loops, objects, and more. This quiz will easily prepare anyone to pass their online test.

1. What is the output of : String.fromCharCode(65) ?

A 1


C error

D false

The method fromCharCode() converts Unicode values to characters.



2. What event do you use to perform something after the page has finished loading?

A onfinished

B onload

C onunload

D oncomplete




3. Which keyword catches all values except those specified?

A all

B any

C default

D otherwise


switch(expression) {
     case a:
     case b:



4. Which of the following is not a property of window object?

A document

B menu

C navigator

D history




6. DOM ____?

A is dedicated for JavaScript

B is a template engine

C describes the structure of the HTML or XML document

D cannot be manipulated by JavaScript




7. Which function does the reverse of split()?

A append()

B unite()

C join()

D concat()

The join() method joins the elements of an array into a string and returns the string.

var arr = ["Hello", "World", "!"];
var message = arr.join();    //Hello World!



8. Which declaration provides the value of a function?

A return

B cancel

C continue

D valueOf




9. Which property is object oriented?

A function

B if statement

C variable

D keyword




10. Which of the following IS NOT a valid function call?

A var x = display();

B display;

C x = display();

D display();



mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *