My Report (&Account)

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. If A is the superclass and B is the subclass, then subclass inheriting the superclass can be represented as _________

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

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

4. The property of JSON() method is __________

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

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

7. The basic difference between JavaScript and Java is _________

8. The meaning for Augmenting classes is that ___________

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

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

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

11. The snippet that filters the filtered set is __________

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

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

13. 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); 

14. 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);  

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

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

 

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

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