Skip to content

Commit 08c0614

Browse files
committed
Fix incorrect answer and explaination for question 90
1 parent d78e477 commit 08c0614

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,7 +2826,7 @@ class Person {
28262826
}
28272827
}
28282828

2829-
const member = new Person("John")
2829+
const member = Person("John")
28302830
console.log(typeof member)
28312831
```
28322832

@@ -2838,7 +2838,7 @@ console.log(typeof member)
28382838
<details><summary><b>Answer</b></summary>
28392839
<p>
28402840

2841-
#### Answer: B
2841+
#### Answer: C
28422842

28432843
Classes are syntactical sugar for function constructors. The equivalent of the `Person` class as a function constructor would be:
28442844

@@ -2848,7 +2848,7 @@ function Person() {
28482848
}
28492849
```
28502850

2851-
Which results in the same value. A class is a function under the hood, the `typeof` keyword returns `"function"` for functions. `typeof Person` returns `"function"`.
2851+
Calling a function constructor with `new` results in the creation of an instance of `Person`, `typeof` keyword returns `"object"` for an instance. `typeof member` returns `"object"`.
28522852

28532853
</p>
28542854
</details>

0 commit comments

Comments
 (0)