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. Consider the JavaScript code:
Identify the value that will be displayed in alert box at line 5?

function lfc(myname){
console.log(10+"lfc" +12);
console.log(res); //line 5


2. The ________ operator is used to create an instance of an object.


3. When will the browser invoke the handler?

Program begins
Any event occurs
Specified event occurs
None of the above

4. Which operator is known as the strict equality operator, which checks whether its two operators are identical or not?


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

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


7. How are windows, tabs, iframes, and frames treated according to client-side javascript?

They are all browsing contexts
They are all browsing information
They are all Window contexts
They are all Window objects

8. 123test is an valid variable name?

Can be true or false
Can not say

9. Which among the following regular expression specifies that password should contain at least one capital letter or one digit.

/.*[A-Z].*/.test(password) && /.*[0-9].*/.test(password)
/.*[A-Z].*/.test(password) || /.*[0-9].*/.test(password)
None of the above

10. Identify the correct syntax to create a JavaScript object for Employee with property empid, empName?

function Ticket(from,to,pName){
this.pName= pName;

var ticket=new Ticket( "Udaipur","Pune","Raj" );

var employee=new Object(); employee.empid=20; employee.empName="John";
var employee ={id:2001,empName:"John"};
var employee=Employee(); employee.empid=20; employee.empName="John";
Both A and C