Skip to content

Commit d78e477

Browse files
committed
Fix question 92 and remove duplicate of 92
1 parent 2f1f358 commit d78e477

File tree

1 file changed

+3
-37
lines changed

1 file changed

+3
-37
lines changed

README.md

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2889,9 +2889,7 @@ function giveLydiaPizza() {
28892889
return "Here is pizza!"
28902890
}
28912891

2892-
function giveLydiaChocolate() {
2893-
return "Here's chocolate... now go hit the gym already."
2894-
}
2892+
const giveLydiaChocolate = () => "Here's chocolate... now go hit the gym already."
28952893

28962894
console.log(giveLydiaPizza.prototype)
28972895
console.log(giveLydiaChocolate.prototype)
@@ -2916,38 +2914,6 @@ Regular functions, such as the `giveLydiaPizza` function, have a `prototype` pro
29162914

29172915
###### 93. What's the output?
29182916

2919-
```javascript
2920-
function giveLydiaPizza() {
2921-
return "Here is pizza!"
2922-
}
2923-
2924-
function giveLydiaChocolate() {
2925-
return "Here's chocolate... now go hit the gym already."
2926-
}
2927-
2928-
console.log(giveLydiaPizza.prototype)
2929-
console.log(giveLydiaChocolate.prototype)
2930-
```
2931-
2932-
- A: `{ constructor: ...}` `{ constructor: ...}`
2933-
- B: `{}` `{ constructor: ...}`
2934-
- C: `{ constructor: ...}` `{}`
2935-
- D: `{ constructor: ...}` `undefined`
2936-
2937-
<details><summary><b>Answer</b></summary>
2938-
<p>
2939-
2940-
#### Answer: D
2941-
2942-
Regular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`.
2943-
2944-
</p>
2945-
</details>
2946-
2947-
---
2948-
2949-
###### 94. What's the output?
2950-
29512917
```javascript
29522918
const person = {
29532919
name: "Lydia",
@@ -2983,7 +2949,7 @@ The second subarray is `[ "age", 21 ]`, with `x` equal to `"age"`, and `y` equal
29832949

29842950
---
29852951

2986-
###### 95. What's the output?
2952+
###### 94. What's the output?
29872953

29882954
```javascript
29892955
function getItems(fruitList, ...args, favoriteFruit) {
@@ -3015,4 +2981,4 @@ getItems(["banana", "apple"], "pear", "orange")
30152981

30162982
The above example works. This returns the array `[ 'banana', 'apple', 'orange', 'pear' ]`
30172983
</p>
3018-
</details>
2984+
</details>

0 commit comments

Comments
 (0)