JavaScript MCQ

JavaScript MCQ

  • Admin
  • 29th Mar, 2021

JavaScript MCQ Quiz

Following are mostly asked Javascript MCQ test that are designed for professionals like you to crack you interviews. You can take this Javascript online test before appearing to you real interview. This Javascript quiz there are around 30+ multiple choice questions on Javascript with four options.

1) The web development environment (JavaScript) offers which standard construct for data validation of the input entered by the user.

  • A. Permit server-side
  • B. Client side Event
  • C. Server page access
  • D. Controlled loop constructs

2) The script tag must be placed in __________

  • A. after the body tag
  • B. the head tag
  • C. the title or head
  • D. the head or body

3) JavaScript is ideal to ________

  • A. make computations in HTML simpler
  • B. increase the download time for the client
  • C. increase the loading time of the website
  • D. minimize storage requirements on the web server

4) JavaScript Code can be called by using ____________

  • A. RMI
  • B. Function/Method
  • C. Preprocessor
  • D. Triggering Event

5) What kind of expression is “new Point(2,3)”?

  • A. Primary Expression
  • B. Invocation Expression
  • C. Object Creation Expression
  • D. Constructor Calling Expression
Download Free : JavaScript MCQ PDF

6) Which of the operator is used to test if a particular property exists or not?

  • A. exist
  • B. within
  • C. in
  • D. exists

7) JavaScript is a _______________ language.

  • A. Object-Oriented
  • B. Object-Based
  • C. High-level
  • D. Assembly-language

8) A conditional expression is also called a _______________

  • A. Switch statement
  • B. Alternative to if-else
  • C. If-then-else statement
  • D. Immediate if

9) What is a block statement in JavaScript?

  • A. conditional block
  • B. block that contains a single statement
  • C. both conditional block and a single statement
  • D. block that combines multiple statements into a single compound statement

10) The “var” and “function” are __________

  • A. Keywords
  • B. Prototypes
  • C. Data types
  • D. Declaration statements

11) Among the keywords below, which one is not a statement?

  • A. if
  • B. use strict
  • C. debugger
  • D. with

12) A linkage of series of prototype objects is called as ________

  • A. prototypes
  • B. prototype class
  • C. prototype stack
  • D. prototype chain

13) The method or operator used to identify the array is __________

  • A. isarrayType()
  • B. ==
  • C. ===
  • D. typeof

14) When does the function name become optional in JavaScript?

  • A. when the function is called
  • B. When the function is predefined
  • C. When the function is defined as expressions
  • D. When the function is defined as a looping statement

15) A function with no return value is called ___________

  • A. Static function
  • B. Dynamic function
  • C. Procedures
  • D. Method

16) Which keyword is used to define the function in javascript?

  • A. void
  • B. int
  • C. main
  • D. function

17) What will happen if a return statement does not have an associated expression?

  • A. It will throw an exception
  • B. It returns the value 0
  • C. It will throw an error
  • D. It returns the undefined value

18) A function with no return value is called ___________

  • A. Dynamic function
  • B. Static function
  • C. Procedures
  • D. Method

19) The function stops its execution when it encounters?

  • A. continue statement
  • B. return statement
  • C. goto statement
  • D. break statement

20) Which keyword is used to define the function in javascript?

  • A. function
  • B. main
  • C. int
  • D. void

21) Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?

  • A. o.m(x,y);
  • B. m(x,y);
  • C. o.m(x) && o.m(y);
  • D. o(x,y);

22) The behaviour of the instances present of a class inside a method is defined by _________

  • A. Interfaces
  • B. Classes
  • C. Method
  • D. Classes and Interfaces

23) The basic difference between JavaScript and Java is _________

  • A. Variables are specific
  • B. There is no difference
  • C. Functions are considered as fields
  • D. Functions are values, and there is no hard distinction between methods and fields

24) The property of JSON() method is __________

  • A. it will be automatically invoked by the compiler
  • B. it can be invoked manually as object.JSON()
  • C. it cannot be invoked in any form
  • D. it is invoked automatically by the JSON.stringify() method

25) When a class B can extend another class A, we say that?

  • A. B is the superclass and A is the subclass
  • B. Both A and B are the subclass
  • C. A is the superclass and B is the subclass
  • D. Both A and B are the superclass

26) Which variables are used internally in object methods and are also globally visible?

  • A. Object properties
  • B. Internal properties
  • C. Variable properties
  • D. Method properties

27) The class that represents the regular expressions is ________

  • A. RegExp
  • B. RegExpObj
  • C. StringExp
  • D. RegExpClass

28) How can we make methods available on all objects?

  • A. Object.add(methods)
  • B. Object.prototype
  • C. Object.methods(add)
  • D. Object.add.methods(…)

29) You can refresh the webpage in JavaScript by using ________

  • A. location.reload
  • B. window.refresh
  • C. page.refresh
  • D. window.reload

30) The maximum number of global symbols a module can define is ____________

  • A. 2
  • B. 3
  • C. 4
  • D. 1

31) The scope of a function is also called as ________

  • A. Module function
  • B. Private function
  • C. Public function
  • D. Predefined function

32) Modules that have more than one item in their API can ________

  • A. Return a namespace object
  • B. Assign itself to a global variable
  • C. Invoke another module of the same kind
  • D. None of the mentioned

33) The provides() function and the exportsobject are used to _________

  • A. Call the modules api
  • B. Store the module’s API
  • C. Register the modules api
  • D. Register the module’s API and Store their API

34) The properties() method is a ________

  • A. Operational method
  • B. Enumerable method
  • C. calling method
  • D. Non-enumerable method

35) The regular expression to match any one character not between the brackets is __________

  • A. […]
  • B. [\D]
  • C. [^]
  • D. [^…]

36) The method that performs the search-and-replace operation to strings for pattern matching is _______

  • A. replace()
  • B. add()
  • C. edit()
  • D. searchandreplace()

37) The Crockford’s subset does not include which function in JavaScript?

  • A. coeval()
  • B. equal()
  • C. eval()
  • D. equivalent()

38) What is being imposed on each subset to ensure that it conforms to the subset?

  • A. A static verifier that parses code
  • B. A parser to parse the code
  • C. A predefined function to parse the code
  • D. A parser that parses and adds to the subset

39) Why was “The Good Parts” designed as a language subset in JavaScript?

  • A. To balance the workload of the programmer
  • B. To improve programmer flexibility
  • C. To improve programmer productivity
  • D. To create an in-built compiler and interpreter

40) Why is this keyword not preferred in JavaScript?

  • A. Functions should not access the global objects
  • B. Functions should access the global objects
  • C. Highly memory consuming
  • D. Very inefficient to use

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

Bootstrap MCQ
Oracle MCQ
Agile Scrum MCQ