JavaScript MCQ

JavaScript MCQ

  • Admin
  • 04th Jul, 2020

JavaScript MCQ Quiz

1) 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

2) The function stops its execution when it encounters?

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

3) 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

4) A conditional expression is also called a _______________

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

5) 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
Download Free : JavaScript MCQ PDF

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

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

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

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

8) The properties() method is a ________

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

9) A function with no return value is called ___________

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

10) The class that represents the regular expressions is ________

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

11) A function with no return value is called ___________

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

12) 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

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

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

14) JavaScript Code can be called by using ____________

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

15) 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

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

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

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

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

18) 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

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

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

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

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

21) JavaScript is a _______________ language.

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

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

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

23) 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

24) 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

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

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

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

  • A. Primary Expression
  • B. Invocation Expression
  • C. Object Creation Expression
  • D. Constructor Calling Expression

27) 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

28) 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

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

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

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

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

31) 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

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

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

33) 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

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

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

35) 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

36) 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

37) 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

38) 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);

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

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

40) 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

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

Laravel MCQ
React JS MCQ
AngularJs MCQ
Node js MCQ
Angular 2 MCQ