Skip to content

Commit 00d5892

Browse files
authored
Merge branch 'master' into new
2 parents 9c260c4 + 28a3f11 commit 00d5892

File tree

4 files changed

+1984
-108
lines changed

4 files changed

+1984
-108
lines changed

README.md

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ List of available languages:
1515
* [العربية](./ar-AR/README_AR.md)
1616
* [اللغة العامية - Egyptian Arabic](./ar-EG/README_ar-EG.md)
1717
* [Bosanski](./bs-BS/README-bs_BS.md)
18-
* [Deutsch](./de-DE/README-de_DE.md)
18+
* [Deutsch](./de-DE/README.md)
1919
* [Español](./es-ES/README-ES.md)
2020
* [Français](./fr-FR/README_fr-FR.md)
2121
* [日本語](./ja-JA/README-ja_JA.md)
@@ -2469,7 +2469,7 @@ The third time, we pass `5 * 2` to the function which gets evaluated to `10`. Th
24692469

24702470
---
24712471

2472-
###### <a name=20190726></a>79. What is the output?
2472+
###### 79. What is the output?
24732473

24742474
```javascript
24752475
const myLifeSummedUp = ["", "💻", "🍷", "🍫"]
@@ -2731,7 +2731,7 @@ By setting `hasName` equal to `name`, you set `hasName` equal to whatever value
27312731

27322732
---
27332733

2734-
###### 87. What's the output?
2734+
###### <a name=20190805></a>87. What's the output?
27352735

27362736
```javascript
27372737
console.log("I want pizza"[0])
@@ -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>
@@ -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) {
@@ -3255,4 +3221,4 @@ With the `||` operator, we can return the first truthy operand. If all values ar
32553221
`([] || 0 || "")`: the empty array`[]` is a truthy value. This is the first truthy value, which gets returned. `three` is equal to `[]`.
32563222

32573223
</p>
3258-
</details>
3224+
</details>

0 commit comments

Comments
 (0)