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 below code?

function password(pass) {
for (i = 0; i < pass.length; i++) {
}
}

function name(pname) {
console.log("The value of i is "+i);
for (i = 0; i < pname.length; i++) {
}
}

password("54321");
name("John");

0
5
undefined
error

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

< p id="demo">< /p>
< script>
var a = 63.786;
document.getElementById ("demo").innerHTML =a.toFixed(0)
< /script>

63.8
63
64
63.77

3. what will be the output of below code?
NOTE: The code is executed on 2019-5-9

var todaysDate = new Date()
console.log( todaysDate.toLocaleString() );

2019-05-09T09:29:53.181Z
2019-5-9
15:00:34
2019-5-9 15:02:35

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

var array = [2, 4, 6, 7, 8, 10];
var myArr= array.filter(v => v / 2 === 0);

console.log(myArr);

myArr
[2, 4, 6, 7, 8, 10]
[2, 4, 6, 8, 10]
[7]

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

function myfun() 
{
document.getElementById ("demo").innerHTML = Boolean(15.00 === 15);
}

true
false
error
0

6. JavaScript is untyped language.

Yes
No
Can be yes or no
Can not say

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

var b5 = Boolean('false');
document.getElementById ("demo").innerHTML =b5;

true
false
error
undefined

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

const pt1 = {}; 
const ob1 = Object.create(pt1);
console.log( Object.getPrototypeOf(ob1) === pt1 );

true
false
errot
0

9. 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;

10. To find the length of a string, use the built-in _______ property.

size
length
area
strlen

Results