Home > MCQs > IT & Programming > JavaScript MCQs

JavaScript MCQ

JavaScript Quick Quiz

Question 1 of 10
  • what is the type of i? var i = NaN;

    Answer & Explanation

    Correct Answer: number

    Note: This Question is unanswered, help us to find answer for this one

  • What will be the output of the following code: for (var i = 0; i < 5; i++) { (function(x) { setTimeout(function() { console.log(x); }, x * 1000 ); })(i); }

    Answer & Explanation

    Correct Answer: 0 1 2 3 4

    Note: This Question is unanswered, help us to find answer for this one

  • What will the value of y be in this code: const x = 6 % 2; const y = x ? 'One' : 'Two';

    Answer & Explanation

    Correct Answer: Two

    Note: This Question is unanswered, help us to find answer for this one

  • What is the RegExp object constructor used for?

    Answer & Explanation

    Correct Answer: Match text against regular expressions

    Note: This Question is unanswered, help us to find answer for this one

  • What is the result of the following expression? ({"foo": true}).foo;

    Answer & Explanation

    Correct Answer: true

    Note: This Question is unanswered, help us to find answer for this one

  • Consider the following code: var bar = (function(){ function Bar(){}; return new Bar(); })(); How will you make another instance of Bar?

    Answer & Explanation

    Correct Answer: new bar.constructor()

    Note: This Question is unanswered, help us to find answer for this one

  • Which statement is True for Behavioral design patterns?

    Answer & Explanation

    Correct Answer: Behavioral design patterns focus on the interdependency and communication between objects

    Note: This Question is unanswered, help us to find answer for this one

  • How do you construct a RegExp object?

    Answer & Explanation

    Correct Answer: var re = new RegExp('ab+c', 'i');

    Note: This Question is unanswered, help us to find answer for this one

  • Which symbol is not used in logical operations?

    Answer & Explanation

    Correct Answer: %

    Note: This Question is unanswered, help us to find answer for this one

  • An infinite loop is an example of a(n) ____ error.

    Answer & Explanation

    Correct Answer: Logic

    Note: This Question is unanswered, help us to find answer for this one

  • JavaScript Quick Quiz

    battery

    Poor Results!

    You need a lot of improvement.

    Just don't give up!

    Correct Answers: 0/10

    Start Practicing with our MCQs given below.