Logo

Javascript Questions Set 105:

Quiz Mode

What does the method Performance.now() return?

1
2
3
4

Solution:

How do we get a DOM object in JavaScript?

1
2
3
4

Solution:

What is the output of the following JavaScript code?

var string2Num = parseInt("123xyz");

1
2
3
4

Solution:

What is the return data type of the accept property that belongs to the Input element?

1
2
3
4

Solution:

How are objects compared when they are checked with the strict equality operator(===)?

1
2
3
4

Solution:

What is the output of the following code?

const obj1 = { property1: '10'};
const obj2 = Object.freeze(obj1);
obj2.property1 = '20';
console.log(obj2.property1);

1
2
3
4

Solution:

What is the output of the following code?

const plants = ['broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato'];

const x = plants.pop();

console.log(x);

1
2
3
4

Solution:

What will be the output of the following JavaScript code?


   emp={id:102,name:"Shyam Kumar",salary:40000}  

   document.write(emp.id+" "+emp.name+" "+emp.salary);

1
2
3
4

Solution:

Which statement(s) should be added to the body of the if statement to turn the red square into a green square when the code executes?

1
2
3
4

Solution:

 

If the user presses “ok” in the dialog box then what will be the output of the following JavaScript code?

function msg()
{  
   var v= confirm("Are u sure?");  
   if(v==true)
   {  
       alert("yes");  
   }  
   else
   {  
       alert("no");  
   }  
}

1
2
3
4

Solution: