Javascript Multiple Choice questions and answers

Javascript is a widely used front-end scripting language and we have listed some of the common, javascript multiple choice questions with answers for you here, which can be good for practicing before going for an interview.

javascript-mcq-questions-answer


Storing numbers, dates, string, or other values

stores string only

allows to store number only

None of the above

View answer

Storing numbers, dates, string, or other values


named function

anonymous function

A and B, both are correct

None of the above

View answer

A and B, both are correct


Live wire JavaScript

Live wire JavaScript is also called server-side JavaScript. LiveWire is an application development environment that uses JavaScript for creating server-based applications and Therefore it is called as server-side JavaScript.

Microsoft

Native

None of the above

View answer

Live wire JavaScript

Live wire JavaScript is also called server-side JavaScript. LiveWire is an application development environment that uses JavaScript for creating server-based applications and Therefore it is called as server-side JavaScript.


onclick

onmousescroller

onmouseover

onmousemove

View answer

onmousescroller


 slice()

 getSubstring()

substr()

none of the above

View answer

substr()


only with external scripts

with internal and external scripts

whether there is javascript or not

The tag  <noscript> defines alternate content for users who have scripting disabled in their browser or whose browser does not support scripting.

only in browsers that don’t know what javascript is.

View answer

whether there is javascript or not

The tag  <noscript> defines alternate content for users who have scripting disabled in their browser or whose browser does not support scripting.


decrements the total length by 1

increments the total length by 1

just print last element of array

none of the above

View answer

decrements the total length by 1


Reverses and stores in the same array

Reverses and concatenates the elements of the array

Reverses

none of the above

View answer

Reverses and stores in the same array


true, false, true

false, false, true

true, false, false

new Number() is a built-in function constructor, so it returns object.

When we use the == operator, it only checks whether it has the same value.

They both have the value of 3, so it returns true.

However, when we use the === operator, both value and type should be the same.

So, the remaining code check, returns false.

false, true, true

View answer

true, false, false

new Number() is a built-in function constructor, so it returns object.

When we use the == operator, it only checks whether it has the same value.

They both have the value of 3, so it returns true.

However, when we use the === operator, both value and type should be the same.

So, the remaining code check, returns false.


JavaClass

JavaArray

JavaObject

None of the above

View answer

JavaArray


44

Since, we are concating string "4" so instead of adding the value, it joins them as a string

8

4

Error

View answer

44

Since, we are concating string "4" so instead of adding the value, it joins them as a string


Target -> Bubbling -> Capturing

Capturing -> Target -> Bubbling

Target -> Capturing -> Bubbling

Capturing -> Bubbling -> Target

View answer

Capturing -> Target -> Bubbling


var txt = new Array(1:"tim",2:"kim",3:"jim")

var txt = new Array:1=("tim")2=("kim")3=("jim")

var txt = new Array("tim","kim","jim")

var txt = new Array="tim","kim","jim"

View answer

var txt = new Array("tim","kim","jim")


That's it, but we will keep adding more javascript interview questions for beginners and advanced front-end developers.

You may also like to read:

Javascript interview questions and answers

jQuery Interview Questions and Answers