My Report

JavaScript Classes Test – 1


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. The keyword or the property that you use to refer to an object through which they were invoked is _________

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

function person()
{  
        this.name = 'rahul';  
}  
function obj() 
{  
       obj.call(this)  
}  
obj.prototype = Object.create(person.prototype);  
const app = new obj();  
console.log(app.name);  

3. The snippet that filters the filtered set is __________

4. The meaning for Augmenting classes is that ___________

5. If A is the superclass and B is the subclass, then subclass inheriting the superclass can be represented as _________

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

const obj1 = 
{  
  	a: 10,  
  	b: 15,  
  	c: 18  
};  
const obj2 = Object.assign({c: 7, d: 1}, obj1);  
console.log(obj2.c, obj2.d); 

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

const prototype1 = {};  
const object1 = Object.create(prototype1);  
console.log(Object.getPrototypeOf(object1) === prototype1);  

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

const obj1 = {  
  property1: 2  
};  
Object.seal(object1);    
obj1.property1 =4;  
console.log(obj1.property1);  
delete obj1.property1;  

9. The basic difference between JavaScript and Java is _________

10. The method that can be used to create new properties and also to modify the attributes of existing properties is _________

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

var o = new F();
o.constructor === F

12. The behaviour of the instances present of a class inside a method is defined by __________

13. The property of JSON() method is __________

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

const object1 = {};  
Object.defineProperties(object1,
{  
  	property1: 
        {  
             value: 10 
        }  
 });  
console.log(object1.property1);  

15. When a class B can extend another class A, we say that?


 

Start practicing “1000 MCQs on JavaScript”, and once you are ready, you can take tests on all topics by attempting our “JavaScript Test Series”.

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.