Skip to content

Commit d172aa6

Browse files
authored
Merge branch 'master' into indonesia-translations-patch-1
2 parents 34c4f4f + 7778c19 commit d172aa6

File tree

17 files changed

+8057
-168
lines changed

17 files changed

+8057
-168
lines changed

README.md

Lines changed: 33 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@
99
From basic to advanced: test how well you know JavaScript, refresh your knowledge a bit, or prepare for your coding interview! :muscle: :rocket: I update this repo regularly with new questions. I added the answers in the **collapsed sections** below the questions, simply click on them to expand it. It's just for fun, good luck! :heart:</span>
1010

1111
Feel free to reach out to me! 😊 <br />
12-
<a href="https://www.instagram.com/theavocoder">Instagram</a> || <a href="https://www.twitter.com/lydiahallie">Twitter</a> || <a href="https:/www.linkedin.com/in/lydia-hallie">LinkedIn</a> || <a href="www.lydiahallie.dev">Blog</a>
13-
14-
</div>
12+
<a href="https://www.instagram.com/theavocoder">Instagram</a> || <a href="https://www.twitter.com/lydiahallie">Twitter</a> || <a href="https://www.linkedin.com/in/lydia-hallie">LinkedIn</a> || <a href="https://www.lydiahallie.dev">Blog</a>
13+
</div>
1514

1615
---
1716

18-
<details><summary><b> See 16 Available Translations 🇪🇸🇮🇹🇩🇪 🇫🇷🇷🇺🇨🇳🇵🇹</b></summary>
17+
<details><summary><b> See 17 Available Translations 🇪🇸🇮🇹🇩🇪 🇫🇷🇷🇺🇨🇳🇵🇹</b></summary>
1918
<p>
2019

21-
- [English](./en-EN/README.md)
22-
- [العربية](./ar-AR/README_AR.md)
23-
- [اللغة العامية - Egyptian Arabic](./ar-EG/README_ar-EG.md)
24-
- [Bosanski](./bs-BS/README-bs_BS.md)
25-
- [Deutsch](./de-DE/README.md)
26-
- [Español](./es-ES/README-ES.md)
27-
- [Français](./fr-FR/README_fr-FR.md)
28-
- [日本語](./ja-JA/README-ja_JA.md)
29-
- [한국어](./ko-KR/README-ko_KR.md)
30-
- [Português Brasil](./pt-BR/README_pt_BR.md)
31-
- [Русский](./ru-RU/README.md)
32-
- [Українська мова](./ua-UA/README-ua_UA.md)
33-
- [Tiếng Việt](./vi-VI/README-vi.md)
34-
- [中文版本](./zh-CN/README-zh_CN.md)
35-
- [Türkçe](./tr-TR/README-tr_TR.md)
36-
- [ไทย](./th-TH/README-th_TH.md)
37-
- [Indonesia](./id-ID/README.md)
20+
* [English](./en-EN/README.md)
21+
* [العربية](./ar-AR/README_AR.md)
22+
* [اللغة العامية - Egyptian Arabic](./ar-EG/README_ar-EG.md)
23+
* [Bosanski](./bs-BS/README-bs_BS.md)
24+
* [Deutsch](./de-DE/README.md)
25+
* [Español](./es-ES/README-ES.md)
26+
* [Français](./fr-FR/README_fr-FR.md)
27+
* [日本語](./ja-JA/README-ja_JA.md)
28+
* [한국어](./ko-KR/README-ko_KR.md)
29+
* [Nederlands](./nl-NL/README.md)
30+
* [Português Brasil](./pt-BR/README_pt_BR.md)
31+
* [Русский](./ru-RU/README.md)
32+
* [Українська мова](./ua-UA/README-ua_UA.md)
33+
* [Tiếng Việt](./vi-VI/README-vi.md)
34+
* [中文版本](./zh-CN/README-zh_CN.md)
35+
* [Türkçe](./tr-TR/README-tr_TR.md)
36+
* [ไทย](./th-TH/README-th_TH.md)
37+
* [Indonesia](./id-ID/README.md)
3838

3939
</p>
4040
</details>
@@ -3227,7 +3227,7 @@ With the `||` operator, we can return the first truthy operand. If all values ar
32273227

32283228
`(false || {} || null)`: the empty object `{}` is a truthy value. This is the first (and only) truthy value, which gets returned. `one` is equal to `{}`.
32293229

3230-
`(null || false || "")`: all operands are falsy values. This means that the past operand, `""` gets returned. `two` is equal to `""`.
3230+
`(null || false || "")`: all operands are falsy values. This means that the last operand, `""` gets returned. `two` is equal to `""`.
32313231

32323232
`([] || 0 || "")`: the empty array`[]` is a truthy value. This is the first truthy value, which gets returned. `three` is equal to `[]`.
32333233

@@ -3271,7 +3271,7 @@ We can get this value with both `.then` and the `await` keyword in an `async` fu
32713271

32723272
In the `firstFunction`, we (sort of) put the myPromise function aside while it was running, but continued running the other code, which is `console.log('second')` in this case. Then, the function resolved with the string `I have resolved`, which then got logged after it saw that the callstack was empty.
32733273

3274-
With the await keyword in `secondFunction`, we literally pause the execution of an async function until the value has been resolved befoer moving to the next line.
3274+
With the await keyword in `secondFunction`, we literally pause the execution of an async function until the value has been resolved before moving to the next line.
32753275

32763276
This means that it waited for the `myPromise` to resolve with the value `I have resolved`, and only once that happened, we moved to the next line: `second` got logged.
32773277

@@ -3409,7 +3409,7 @@ console.log(colorConfig.colors[1]);
34093409

34103410
In JavaScript, we have two ways to access properties on an object: bracket notation, or dot notation. In this example, we use dot notation (`colorConfig.colors`) instead of bracket notation (`colorConfig["colors"]`).
34113411

3412-
With dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no proprety called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that's `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`.
3412+
With dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no property called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that's `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`.
34133413

34143414
JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would've used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object.
34153415

@@ -3471,7 +3471,7 @@ With `splice` method, we modify the original array by deleting, replacing or add
34713471

34723472
---
34733473

3474-
###### <a name=20191009></a>109. What's the output?
3474+
###### 109. What's the output?
34753475

34763476
```javascript
34773477
const food = ['🍕', '🍫', '🥑', '🍔'];
@@ -4466,39 +4466,7 @@ However, it only _shallowly_ freezes the object, meaning that only _direct_ prop
44664466
44674467
---
44684468
4469-
###### 138. Which of the following will modify the `person` object?
4470-
4471-
```javascript
4472-
const person = {
4473-
name: 'Lydia Hallie',
4474-
address: {
4475-
street: '100 Main St',
4476-
},
4477-
};
4478-
4479-
Object.freeze(person);
4480-
```
4481-
4482-
- A: `person.name = "Evan Bacon"`
4483-
- B: `delete person.address`
4484-
- C: `person.address.street = "101 Main St"`
4485-
- D: `person.pet = { name: "Mara" }`
4486-
4487-
<details><summary><b>Answer</b></summary>
4488-
<p>
4489-
4490-
#### Answer: C
4491-
4492-
The `Object.freeze` method _freezes_ an object. No properties can be added, modified, or removed.
4493-
4494-
However, it only _shallowly_ freezes the object, meaning that only _direct_ properties on the object are frozen. If the property is another object, like `address` in this case, the properties on that object aren't frozen, and can be modified.
4495-
4496-
</p>
4497-
</details>
4498-
4499-
---
4500-
4501-
###### 139. What's the output?
4469+
###### 138. What's the output?
45024470
45034471
```javascript
45044472
const add = x => x + x;
@@ -4530,7 +4498,7 @@ Then, we invoked `myFunc(3)` and passed the value `3` as the value for the argum
45304498
45314499
---
45324500
4533-
###### 140. What's the output?
4501+
###### 139. What's the output?
45344502
45354503
```javascript
45364504
class Counter {
@@ -4568,7 +4536,7 @@ In ES2020, we can add private variables in classes by using the `#`. We cannot a
45684536
45694537
---
45704538
4571-
###### 141. What's the output?
4539+
###### 140. What's missing?
45724540
45734541
```javascript
45744542
const teams = [
@@ -4612,7 +4580,7 @@ If we would've written `yield`, `return yield`, or `return`, the entire generato
46124580
46134581
---
46144582
4615-
###### 142. What's the output?
4583+
###### 141. What's the output?
46164584
46174585
```javascript
46184586
const person = {
@@ -4657,7 +4625,7 @@ After pushing `dancing` and `baking`, the value of `person.hobbies` is `["coding
46574625
46584626
---
46594627
4660-
###### 143. What's the output?
4628+
###### 142. What's the output?
46614629
46624630
```javascript
46634631
class Bird {
@@ -4693,7 +4661,7 @@ We create the variable `pet` which is an instance of the `Flamingo` class. When
46934661

46944662
---
46954663

4696-
###### 144. Which of the options result(s) in an error?
4664+
###### 143. Which of the options result(s) in an error?
46974665

46984666
```javascript
46994667
const emojis = ['🎄', '🎅🏼', '🎁', '⭐'];
@@ -4721,7 +4689,7 @@ The `const` keyword simply means we cannot _redeclare_ the value of that variabl
47214689

47224690
---
47234691

4724-
###### 145. What do we need to add to the `person` object to get `["Lydia Hallie", 21]` as the output of `[...person]`?
4692+
###### 144. What do we need to add to the `person` object to get `["Lydia Hallie", 21]` as the output of `[...person]`?
47254693

47264694
```javascript
47274695
const person = {
@@ -4734,7 +4702,7 @@ const person = {
47344702
47354703
- A: Nothing, object are iterable by default
47364704
- B: `*[Symbol.iterator]() { for (let x in this) yield* this[x] }`
4737-
- C: `*[Symbol.iterator]() { for (let x in this) yield* Object.values(this) }`
4705+
- C: `*[Symbol.iterator]() { yield* Object.values(this) }`
47384706
- D: `*[Symbol.iterator]() { for (let x in this) yield this }`
47394707
47404708
<details><summary><b>Answer</b></summary>

ar-AR/README_AR.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
* [Español](../es-ES/README-ES.md)
2323
* [Français](../fr-FR/README_fr-FR.md)
2424
* [日本語](../ja-JA/README-ja_JA.md)
25-
* [한국어](../ko-KR/README-ko_KR.md)
25+
* [한국어](../ko-KR/README-ko_KR.md)
26+
* [Nederlands](./nl-NL/README.md)
2627
* [Português Brasil](../pt-BR/README_pt_BR.md)
2728
* [Русский](../ru-RU/README.md)
2829
* [Українська мова](../ua-UA/README-ua_UA.md)

bs-BS/README-bs_BS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ kliknite na njih da biste ih proširili. Sretno :heart:
2020
* [Español](../es-ES/README-ES.md)
2121
* [Français](../fr-FR/README_fr-FR.md)
2222
* [日本語](../ja-JA/README-ja_JA.md)
23-
* [한국어](../ko-KR/README-ko_KR.md)
23+
* [한국어](../ko-KR/README-ko_KR.md)
24+
* [Nederlands](./nl-NL/README.md)
2425
* [Português Brasil](../pt-BR/README_pt_BR.md)
2526
* [Русский](../ru-RU/README.md)
2627
* [Українська мова](../ua-UA/README-ua_UA.md)

de-DE/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Die Antworten sind unterhalb der Fragen versteckt. Du kannst einfach darauf klic
1515
* [Español](../es-ES/README-ES.md)
1616
* [Français](../fr-FR/README_fr-FR.md)
1717
* [日本語](../ja-JA/README-ja_JA.md)
18-
* [한국어](../ko-KR/README-ko_KR.md)
18+
* [한국어](../ko-KR/README-ko_KR.md)
19+
* [Nederlands](./nl-NL/README.md)
1920
* [Português Brasil](../pt-BR/README_pt_BR.md)
2021
* [Русский](../ru-RU/README.md)
2122
* [Українська мова](../ua-UA/README-ua_UA.md)

0 commit comments

Comments
 (0)