Javascript Programming Quiz


Play this Javascript quiz that will help you to excel in Javascript certification exams, placements etc. This Javascript programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This Javascript programming test enables you to assess your knowledge of Javascript programming.

Take the Free Practice Test



Javascript MCQs

Practice Javascript MCQ Questions, which will help you to clear your JS related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

Javascript Quiz

Try Free Javascript Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

Javascript Quiz

1. What will be the output of the following JavaScript code?

System.out.println( Pattern.matches("[lfc]+", "f") );

true
false
undefined
1

2. What will be the output of the following JavaScript code?

function myfun()
{
var a = "";
document.getElementById ("demo").innerHTML = Boolean(a);
}

true
false
error
undefined

3. When you invoke the........ method on a function f and pass an object o, the method returns a new function.

apply()
call()
bind()
string()

4. Variables are declared with the _______ keyword.

this
int
var
new

5. What does the following JavaScript code snippet do?

data.sort(function(a,b),b-a);

Sort in the alphabetical order
Sort in the chronological order
Sort in reverse alphabetical order
Sort in reverse numerical order

6. A __________ will be visible only within a function where it is defined.

global variables
local variable
Both A and B
None of the above

7. The HTML DOM is a standard object model and programming interface for HTML.

TRUE
FALSE
Can be true or false
Can not say

8. The statement is an example of:

while (3==3) {}

A typographical error
An infinite loop
An illegal JavaScript statement
None of the above

9. what will be the output of below code?

var val = "JavaScript String"
splittedVal = val.split('a',2)
console.log(splittedVal);

[ 'J', 'v' ]
[ 'J' ,'v','Script']
[ 'J', 'v', 'Script String' ]
[ 'JavaScript String' ]

10. What will be printed in the console on execution of the below code?

var materials = [
'Table',
'Chair',
'Boxes',
'Press'
];

console.log(materials.map (material => material.length));

[5,5,5,5]
[5]{4}
[5]
Both A and B

Results