Skip to content

Commit cc6fd09

Browse files
committed
merging all conflicts
2 parents 44b8253 + 58f6599 commit cc6fd09

File tree

17 files changed

+319
-205
lines changed

17 files changed

+319
-205
lines changed

1-js/02-first-steps/05-types/article.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ Kita akan mengcover string lebih dalam di bab <info:string>.
132132
```smart header="Tidak ada tipe *character*."
133133
Dalam beberapa bahasa, ada tipe "character" spesial untuk karakter tunggal. Misalnya, di bahasa C dan di Java adalah `char`.
134134
135+
<<<<<<< HEAD
135136
Di JavaScript, tak ada tipe semacam itu. Cuma ada satu tipe: `string`. String bisa berisi satu karakter atau lebih.
137+
=======
138+
In JavaScript, there is no such type. There's only one type: `string`. A string may consist of zero characters (be empty), one character or many of them.
139+
>>>>>>> 58f6599df71b8d50417bb0a52b1ebdc995614017
136140
```
137141

138142
## Boolean (tipe logika)

1-js/03-code-quality/04-ninja-code/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Kode ninja
22

33

4-
```quote author="Confucius"
4+
```quote author="Confucius (Analects)"
55
Learning without thought is labor lost; thought without learning is perilous.
66
```
77

@@ -104,8 +104,8 @@ Baca cepan kode begini makin mustahil. Dan saat ada typo... Ummm... Kita stuck c
104104

105105
## Synonym pintar
106106

107-
```quote author="Confucius"
108-
The hardest thing of all is to find a black cat in a dark room, especially if there is no cat.
107+
```quote author="Laozi (Tao Te Ching)"
108+
The Tao that can be told is not the eternal Tao. The name that can be named is not the eternal name.
109109
```
110110

111111
Memakai nama *serupa* untuk hal *sama* membuat hidup menarik dan menampilkan kreatifitasmu ke publik.

1-js/04-object-basics/07-optional-chaining/article.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ Jika tidak terdapat variabel `user` sama sekali, lalu `user?.anything` akan menc
7979
// ReferenceError: user is not defined
8080
user?.address;
8181
```
82+
<<<<<<< HEAD
8283
Haruslah ada `let/const/var user`. Rantai opsional hanya bekerja untuk variabel yang telah dideklarasikan.
84+
=======
85+
There must be `let/const/var user`. The optional chaining works only for declared variables.
86+
>>>>>>> 58f6599df71b8d50417bb0a52b1ebdc995614017
8387
````
8488

8589
## Short-circuiting

1-js/05-data-types/04-array/article.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,15 @@ Sebuah *array* adalah objek yang spesial. Tanda kurung siku digunakan untuk meng
193193

194194
Sintaks tersebut memperpanjang objek yang menyediakan metode khusus untuk berfungsi dengan koleksi-koleksi data yang tertata serta properti `length`. Tetapi pada intinya, *array* tetaplah sebuah objek.
195195

196+
<<<<<<< HEAD
196197
<<<<<<< HEAD
197198
Ingat, ada 7 tipe (data) dasar dalamJavaScript. *Array* adalah sebuah objek dan oleh karena itu berperilaku selayaknya sebuah objek.
198199
=======
199200
Remember, there are only eight basic data types in JavaScript (see the [Data types](https://javascript.info/types) chapter for more info). Array is an object and thus behaves like an object.
200201
>>>>>>> f830bc5d9454d85829e011d914f215eb5896579a
202+
=======
203+
Remember, there are only eight basic data types in JavaScript (see the [Data types](info:types) chapter for more info). Array is an object and thus behaves like an object.
204+
>>>>>>> 58f6599df71b8d50417bb0a52b1ebdc995614017
201205
202206
Sebagai contoh, *array* disalin oleh referensi:
203207

1-js/05-data-types/06-iterable/article.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,29 @@ alert( str.slice(1, 3) ); // tidak berguna (dua bagian dari karakter pengganti y
293293

294294
Objek yang bisa digunakan didalam `for..if` dipanggil dengan *iterable*.
295295

296+
<<<<<<< HEAD
296297
- Secara teknis, iterables harus mengimplementasi nama metode `Symbol.iterator`.
297298
- Hasil dari `obj[Symbol.iterator]` dipanggil dengan sebuah *iterator*. Itu menangani proses iterasi lebih jauh.
298299
- Sebuah iterator harus mempunyai nama metode `next()` yang mengembalikan sebuah objek `{done: Boolean, value: any}`, disini `done:true` menandakan akhir dari proses iterasi, sebaliknya `value` adalah nilai selanjutnya.
299300
- Metode `Symbol.iterator` dipanggil secara otomatis oleh `for..of`, tapi kita bisa melakukannya secara langsung.
300301
- Iterables bawaan seperti string atau array, juga mengimplementasikan `Symbol.iterator`.
301302
- Iterator string tahu tentang karakter pengganti (surrogate pairs).
303+
=======
304+
- Technically, iterables must implement the method named `Symbol.iterator`.
305+
- The result of `obj[Symbol.iterator]()` is called an *iterator*. It handles the further iteration process.
306+
- An iterator must have the method named `next()` that returns an object `{done: Boolean, value: any}`, here `done:true` denotes the end of the iteration process, otherwise the `value` is the next value.
307+
- The `Symbol.iterator` method is called automatically by `for..of`, but we also can do it directly.
308+
- Built-in iterables like strings or arrays, also implement `Symbol.iterator`.
309+
- String iterator knows about surrogate pairs.
310+
>>>>>>> 58f6599df71b8d50417bb0a52b1ebdc995614017
302311
303312

304313
Objek yang mempunyai properti indeks dan `length` dipanggil dengan *seperti-array/array-like*. Objek seperti itu mungkin mempunyai properti dan metode lainnya, tapi tidak memiliki metode bawaan dari array.
305314

306315
Jika kita melihat kedalam spesifikasinya -- kita akan melihat kebanyakan metode bawaan yang mengasumsikan bahwa mereka bekerja dengan iterables atau seperti-array daripada dengan array "sungguhan", karena hal itu lebih abstrak.
307316

317+
<<<<<<< HEAD
308318
`Array.from(obj[, mapFn, thisArg])` membuak `Array` sungguhan dari sebuah iterable atau seperti-array `obj`, dan lalu kita bisa menggunakan metode array didalamnya. Argumen opsional `mapFn` dan `thisArg` memperbolehan kita untuk menerapkan sebuah fungsi kedalam setiap item.
319+
=======
320+
`Array.from(obj[, mapFn, thisArg])` makes a real `Array` from an iterable or array-like `obj`, and we can then use array methods on it. The optional arguments `mapFn` and `thisArg` allow us to apply a function to each item.
321+
>>>>>>> 58f6599df71b8d50417bb0a52b1ebdc995614017

1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/task.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ Maka jika fungsi pembungkus dipanggil pada 0ms, 200ms, dan 500ms, dan lalu tidak
1616

1717
...Dan itu akan mendapatkan argumen dari pemanggilan yang paling terakhir, pemanggilan lainnya akan diabaikan.
1818

19+
<<<<<<< HEAD
1920
Ini adalah kodenya (digunakan untuk dekorator debounce dari [Lodash library](https://lodash.com/docs/4.17.15#debounce)):
21+
=======
22+
Here's the code for it (uses the debounce decorator from the [Lodash library](https://lodash.com/docs/4.17.15#debounce)):
23+
>>>>>>> 58f6599df71b8d50417bb0a52b1ebdc995614017
2024
2125
```js
2226
let f = _.debounce(alert, 1000);

1-js/08-prototypes/03-native-prototypes/article.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ We can check it like this:
3333
let obj = {};
3434

3535
alert(obj.__proto__ === Object.prototype); // true
36-
// obj.toString === obj.__proto__.toString == Object.prototype.toString
36+
37+
alert(obj.toString === obj.__proto__.toString); //true
38+
alert(obj.toString === Object.prototype.toString); //true
3739
```
3840

3941
Please note that there is no more `[[Prototype]]` in the chain above `Object.prototype`:

1-js/09-classes/02-class-inheritance/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ Why is there the difference?
364364

365365
Well, the reason is in the field initialization order. The class field is initialized:
366366
- Before constructor for the base class (that doesn't extend anything),
367-
- Imediately after `super()` for the derived class.
367+
- Immediately after `super()` for the derived class.
368368

369369
In our case, `Rabbit` is the derived class. There's no `constructor()` in it. As said previously, that's the same as if there was an empty constructor with only `super(...args)`.
370370

@@ -545,7 +545,7 @@ Here's the demo of a wrong `super` result after copying:
545545
```js run
546546
let animal = {
547547
sayHi() {
548-
console.log(`I'm an animal`);
548+
alert(`I'm an animal`);
549549
}
550550
};
551551
@@ -559,7 +559,7 @@ let rabbit = {
559559
560560
let plant = {
561561
sayHi() {
562-
console.log("I'm a plant");
562+
alert("I'm a plant");
563563
}
564564
};
565565

0 commit comments

Comments
 (0)