Java Script Quiz4 1. What is inheritance in JavaScript? It is a way of creating a new class based on an existing class. It is a way of adding properties to an object. It is a way of creating an object based on a template. 2. What is a class in JavaScript? It is a built-in data type in JavaScript. It is a template for creating objects. It is a function in JavaScript. 3. What is the syntax for creating a class in JavaScript? class MyClass {} MyClass = class {} Both a and b are correct. 4. What is the instanceof operator in JavaScript used for? It is used to check if an object is an instance of a specific class. It is used to compare two objects for equality. It is used to check if a variable is null. 5. What is a method in JavaScript? It is a property of an object that contains a function. It is a built-in function in JavaScript. It is a block of code in JavaScript. 6. What is a static method in a class in JavaScript? It is a method that is called automatically when an object is created. It is a method that is used to add a property to a class. It is a method that can be called on the class itself, rather than on an instance of the class. 7. What is a getter in a class in JavaScript? It is a method that is used to set the value of a property. It is a method that is used to retrieve the value of a property. It is a method that is used to delete a property. 8. What is a constructor in a class in JavaScript? It is a method that is called when an object is created. It is a property of a class. It is a reserved keyword in JavaScript. 9. What is the typeof operator in JavaScript used for? It is used to check if a variable is null. It is used to check the type of a value or variable. It is used to perform mathematical operations on values. 10. What is the keyword used to extend a class in JavaScript? extends inherits inheritsFrom Loading … Question 1 of 10