Skip to content

Commit

Permalink
refactor(curriculum): js classes quiz (freeCodeCamp#58526)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihechikara authored Jan 31, 2025
1 parent ee43b95 commit 8e8c5b0
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ What does `this` represent inside a class constructor?

#### --distractors--

The global object.
The global class object.

---

Expand All @@ -99,7 +99,7 @@ An undefined reference.

#### --answer--

The instance of the class being created.
An instance of the class.

### --question--

Expand All @@ -109,19 +109,19 @@ 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.

---

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

Expand All @@ -131,19 +131,19 @@ 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.

---

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

Expand Down Expand Up @@ -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--

Expand Down Expand Up @@ -490,7 +490,7 @@ An undefined variable.

#### --answer--

The specific instance of `Animal` being created.
The instance of `Animal`.

### --question--

Expand All @@ -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.

---

Expand All @@ -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.

0 comments on commit 8e8c5b0

Please sign in to comment.