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?

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

true
false
error
undefined

2. 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]

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

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

50
20+30
2030
error

4. Consider the JavaScript code:
Choose the correct code to be inserted at line 4 in order to invoke the function.

thisfun=function lfc(x){
console.log(x*x);
}
// line 4

thisfun(10)
lfc(10)
function thisfun(10)
None of the above

5. If the operator value is null, then the unary operator returns the typeof …………….

undefined
object
boolean
string

6. Which of the following statements is/are TRUE about DOM?

W3C standard
Each page can have multiple Document objects
form elements can be accessed using the form object
Both A and C

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

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

 System.out.println( Pattern.matches("[^lfc]", "letsfind") );

true
false
undefined
l

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

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