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. When you invoke the........ method on a function f and pass an object o, the method returns a new function.

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

2. What will be printed in the console on execution of the following JS code:

var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
var myArr= array.filter(v => v % 3 === 0);

console.log(myArr);

myArr
[3, 6, 9, 12, 15]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
[1, 2, 4, 5, 7, 8, 10, 11, 13, 14]

3. If var A={B:3, C:5}, how to use the delete operator to delete one of the properties of an object.

delete
delete A
delete A.B
delete A[0]

4. What will be the output of the below code ?

var package;
console.log("Package: " + package)
console.log("Amount: " + amount);

Package: null; Amount: null;
Package: undefined; Amount: undefined;
Package: null; An ReferenceError is thrown saying amount is not defined;
Package: undefined; An ReferenceError is thrown saying amount is not defined;

5. Which object is the top of the hierarchy?

Form Control Elements
Document Object
Form Object
Window Object

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

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

true
false
error
undefined

7. What is the code required to delete all “weight” tags?

delete weight(pt).all;
delete pt.element[all];
delete pt;
delete pt..weight;

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

< p id="demo">< /p>
< script>
var a = 20;
var b = "30";
var c = a + b;
document.getElementById ("demo").innerHTML = c;
< /script>

50
20+30
2030
error

9. Which of the following is the descendant operator?

..
...
*
@

10. What is the code to be used to trim whitespaces?

let trimmed = (l.trim() for (l in lines));
let trimmed = (trim(l));
let trimmed = l.trim();
let trimmed = for(l in lines));

Results