You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/05-types/article.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,11 @@ Kita akan mengcover string lebih dalam di bab <info:string>.
132
132
```smart header="Tidak ada tipe *character*."
133
133
Dalam beberapa bahasa, ada tipe "character" spesial untuk karakter tunggal. Misalnya, di bahasa C dan di Java adalah `char`.
134
134
135
+
<<<<<<< HEAD
135
136
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.
Copy file name to clipboardExpand all lines: 1-js/05-data-types/04-array/article.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,11 +193,15 @@ Sebuah *array* adalah objek yang spesial. Tanda kurung siku digunakan untuk meng
193
193
194
194
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.
195
195
196
+
<<<<<<< HEAD
196
197
<<<<<<< HEAD
197
198
Ingat, ada 7 tipe (data) dasar dalamJavaScript. *Array* adalah sebuah objek dan oleh karena itu berperilaku selayaknya sebuah objek.
198
199
=======
199
200
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.
200
201
>>>>>>> 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.
Copy file name to clipboardExpand all lines: 1-js/05-data-types/06-iterable/article.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -293,16 +293,29 @@ alert( str.slice(1, 3) ); // tidak berguna (dua bagian dari karakter pengganti y
293
293
294
294
Objek yang bisa digunakan didalam `for..if` dipanggil dengan *iterable*.
295
295
296
+
<<<<<<< HEAD
296
297
- Secara teknis, iterables harus mengimplementasi nama metode `Symbol.iterator`.
297
298
- Hasil dari `obj[Symbol.iterator]` dipanggil dengan sebuah *iterator*. Itu menangani proses iterasi lebih jauh.
298
299
- 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.
299
300
- Metode `Symbol.iterator` dipanggil secara otomatis oleh `for..of`, tapi kita bisa melakukannya secara langsung.
300
301
- Iterables bawaan seperti string atau array, juga mengimplementasikan `Symbol.iterator`.
301
302
- 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
302
311
303
312
304
313
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.
305
314
306
315
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.
307
316
317
+
<<<<<<< HEAD
308
318
`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.
Copy file name to clipboardExpand all lines: 1-js/09-classes/02-class-inheritance/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -364,7 +364,7 @@ Why is there the difference?
364
364
365
365
Well, the reason is in the field initialization order. The class field is initialized:
366
366
- 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.
368
368
369
369
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)`.
370
370
@@ -545,7 +545,7 @@ Here's the demo of a wrong `super` result after copying:
0 commit comments