refactor(curriculum): js classes quiz (#58526)

This commit is contained in:
Ihechikara Vincent Abba
2025-01-31 23:01:36 +01:00
committed by GitHub
parent ee43b956ae
commit 8e8c5b09fa

View File

@@ -87,7 +87,7 @@ What does `this` represent inside a class constructor?
#### --distractors--
The global object.
The global class object.
---
@@ -99,7 +99,7 @@ An undefined reference.
#### --answer--
The instance of the class being created.
An instance of the class.
### --question--
@@ -109,7 +109,7 @@ Which of the following describes how `this` behaves in an arrow function inside
#### --distractors--
It refers to the method calling the arrow function.
It inherits the value of `this` from the nearest function in a different scope.
---
@@ -117,11 +117,11 @@ It refers to a newly created instance of the class.
---
It refers to `undefined` by default.
It inherits the value of `this` from the global object in strict mode.
#### --answer--
It inherits the value of `this` from the enclosing scope where they are defined.
It inherits the value of `this` from the enclosing scope where it is defined.
### --question--
@@ -131,7 +131,7 @@ What is the primary purpose of the `extends` keyword?
#### --distractors--
To define static methods in a class.
To define static methods in a parent class constructor.
---
@@ -139,11 +139,11 @@ To create a method in a class.
---
To initialize properties in the parent class.
To initialize default properties in the parent class.
#### --answer--
To create a subclass that inherits methods from a parent class.
To create a subclass that inherits from a parent class.
### --question--
@@ -222,15 +222,15 @@ What is the function of the `super` keyword in a subclass?
#### --distractors--
To define a new instance of a class.
To define a new instance of the parent class.
---
To delete properties from a class.
To delete methods and properties from the parent class.
---
To access only the static methods of a class.
To access only the static methods of the parent class.
#### --answer--
@@ -490,7 +490,7 @@ An undefined variable.
#### --answer--
The specific instance of `Animal` being created.
The instance of `Animal`.
### --question--
@@ -500,7 +500,7 @@ What is the primary use of static properties?
#### --distractors--
To set default values for each instance.
To define default propeties for each class instance.
---
@@ -512,4 +512,4 @@ To define instance-specific data.
#### --answer--
To store class-wide data that remains constant across instances.
To store class-wide data shared across instances.