MCQ

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

B A

C error

D false

B
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

B

 

 

3. Which keyword catches all values except those specified?

A all

B any

C default

D otherwise

C
Syntax:

switch(expression) {
     case a:
          //instructions
          break;
     case b:
          //instructions
          break;
     default:
          //instructions
}

 

 

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

A document

B menu

C navigator

D history

B

 

 

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

C

 

 

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

A append()

B unite()

C join()

D concat()

C
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

A

 

 

9. Which property is object oriented?

A function

B if statement

C variable

D keyword

C

 

 

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

A var x = display();

B display;

C x = display();

D display();

B

 

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 *