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/01-getting-started/1-intro/article.md
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,9 @@ Browser punya engine yang tertanam didalamnya yang disebut "JavaScript virtual m
24
24
25
25
Tiap engine punya *codename*-nya sendiri. Misalnya:
26
26
27
-
<<<<<<< HEAD
28
27
-[V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- di Chrome dan Opera.
29
28
-[SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- di Firefox.
30
29
- ...Ada juga codename lain seperti "Trident" dan "Chakra" untuk versi berbeda dari IE, "ChakraCore" untuk Microsoft Edge, "Nitro" dan "SquirrelFish" untuk Safari, dll.
31
-
=======
32
-
-[V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
33
-
-[SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
34
-
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc.
35
-
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
36
30
37
31
Istilah di atas sebaiknya diingat karena akan sering digunakan dalam artikel para developer di internet. Kita akan menggunakannya juga. Misalnya, jika "fitur X didukung V8", kemungkinan ia bisa jalan di Chrome dan Opera.
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/2-manuals-specifications/article.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,7 @@ Versi spesifikasi baru dirilis tiap tahun. Di antara rilis ini, draft spesifikas
13
13
14
14
Untuk membaca tentang fitur terkini, termasuk yang "hampir menjadi standar" (disebut "stage 3"), lihat proposalnya di <https://github.com/tc39/proposals>.
15
15
16
-
<<<<<<< HEAD
17
16
Juga, jika kamu dalam pengembangan untuk peramban, maka ada spek lain yang dibahas di [bagian kedua](info:browser-environment) di tutorial ini.
18
-
=======
19
-
Also, if you're developing for the browser, then there are other specifications covered in the [second part](info:browser-environment) of the tutorial.
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/4-devtools/article.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,7 @@ Supaya bisa melihat error dan memperoleh informasi berfaedah lainnya dari script
8
8
9
9
Kebanyakan pengembang memakai Chrome atau Firefox untuk pengembangan karena tools pengembangan yang mereka punya paling mantap. Peramban lain punya juga koq, ada with special features, but are usually playing "catch-up" to Chrome or Firefox. So most developers have a "favorite" browser and switch to others if a problem is browser-specific.
10
10
11
-
<<<<<<< HEAD
12
-
Tools pengembang mengandung faedah; mereka punya banyak fitur. Untuk memulainya, kita akan belajar cara membuka mereka, mencari error, dan menjalankan perintah JavaScript.
13
-
=======
14
-
Developer tools are potent; they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.
15
-
>>>>>>> 6ab384f2512902d74e4b0ff5a6be60e48ab52e96
11
+
Tools pengembang mengandung banyak manfaat; mereka punya banyak fitur. Untuk memulainya, kita akan belajar cara membuka mereka, mencari error, dan menjalankan perintah JavaScript.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/02-structure/article.md
-26Lines changed: 0 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,11 +46,7 @@ alert(3 +
46
46
+2);
47
47
```
48
48
49
-
<<<<<<< HEAD
50
49
Output dari kode itu adalah `6` karena JavaScript tak menyisipkan titik koma di sini. Sudah jelas sekali bahwa barisnya selesai dengan tanda plus `"+"`, sehingga itu menjadi "expresi tak lengkap", jadi tak butuh titik koma. Dan dalam hal ini memang seperti itu.
51
-
=======
52
-
The code outputs `6` because JavaScript does not insert semicolons here. It is intuitively obvious that if the line ends with a plus `"+"`, then it is an "incomplete expression", so a semicolon there would be incorrect. And in this case, that works as intended.
53
-
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
54
50
55
51
**Tapi ada situasi di mana JavaScript "gagal" mengasumsi titik koma di mana itu benar-benar dibutuhkan.**
56
52
@@ -65,58 +61,36 @@ alert("Hello");
65
61
[1, 2].forEach(alert);
66
62
```
67
63
68
-
<<<<<<< HEAD
69
64
Untuk sekarang tak usah memikirkan makna kurung siku `[]` dan `forEach`. Kita akan mempelajari mereka nanti. Untuk sekarang, ingat hasil kode tersebut: yaitu `1` lalu `2`.
70
65
71
66
Sekarang, ayo kita tambahkan `alert` sebelum kodenya *tanpa* diikuti titik koma:
72
-
=======
73
-
No need to think about the meaning of the brackets `[]` and `forEach` yet. We'll study them later. For now, just remember the result of running the code: it shows `Hello`, then `1`, then `2`.
74
-
75
-
Now let's remove the semicolon after the `alert`:
76
-
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
77
67
78
68
```js run no-beautify
79
69
alert("Hello")
80
70
81
71
[1, 2].forEach(alert);
82
72
```
83
73
84
-
<<<<<<< HEAD
85
74
Sekarang jika kita menjalankan kodenya, hanya `alert` pertama yang tampil dan kemudian galat!
86
75
87
76
Tapi semua akan baik-baik saja jika kita menambahkan titik koma setelah `alert`:
88
77
```js run
89
78
alert("All fine now");
90
-
=======
91
-
The difference compared to the code above is only one character: the semicolon at the end of the first line is gone.
92
-
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
93
79
94
80
If we run this code, only the first `Hello` shows (and there's an error, you may need to open the console to see it). There are no numbers any more.
95
81
96
-
<<<<<<< HEAD
97
82
Sekarang kita punya pesan "All fine now" diikuti dengan `1` dan `2`.
98
83
99
84
100
85
Galat muncul pada varian tanpa titik koma karena JavaScript tak mengasumsikan titik koma sebelum kurung siku `[...]`.
101
86
102
87
Jadi, karena titik koma tidak otomatis disisipkan, kode di contoh pertama diperlakukan sebagai pernyataan tunggal. Inilah cara engine melihatnya:
103
-
=======
104
-
That's because JavaScript does not assume a semicolon before square brackets `[...]`. So, the code in the last example is treated as a single statement.
105
-
106
-
Here's how the engine sees it:
107
-
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
108
88
109
89
```js run no-beautify
110
90
alert("Hello")[1, 2].forEach(alert);
111
91
```
112
92
113
-
<<<<<<< HEAD
114
93
Tapi itu harus jadi dua pernyataan terpisah, bukan satu. Penyatuan macam ini salah pada kasus ini, makanya galat. Ini bisa terjadi dalam situasi lain.
115
-
=======
116
-
Looks weird, right? Such merging in this case is just wrong. We need to put a semicolon after `alert` for the code to work correctly.
117
-
118
-
This can happen in other situations also.
119
-
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
120
94
````
121
95
122
96
Kami sarankan menaruh titik koma di antara pernyataan meski mereka dipisahkan garis baru. Ini aturan yang diterima secara luas oleh komunitas. Harap diingat sekali lagi bahwa -- *bisa saja* menanggalkan titik koma di banyak kesempatan. Tapi akan lebih aman -- terutama untuk pemula -- untuk menggunakan mereka.
Sebenarnya `BigInt` jarang dibutuhkan, kita tidak akan mempelajarinya disini, tetapi akan dipisahkan didalam bagian <info:bigint>. Baca saja saat kamu membutuhkan nilai *integer* yang sangat panjang.
83
83
84
-
<<<<<<<HEAD
85
-
<<<<<<<HEAD
84
+
86
85
```smart header="Masalah Kompabilitas"
87
86
Sekarang `BigInt` sudah didukung oleh Firefox/Chrome/Edge, tapi tidak didalam Safari/Internet Explorer.
88
-
=======
89
-
```smart header="Compatibility issues"
90
-
Right now `BigInt` is supported in Firefox/Chrome/Edge, but not in Safari/IE.
91
-
>>>>>>> f830bc5d9454d85829e011d914f215eb5896579a
92
-
=======
93
-
94
-
```smart header="Compatibility issues"
95
-
Right now, `BigInt` is supported in Firefox/Chrome/Edge/Safari, but not in IE.
96
-
>>>>>>> f489145731a45df6e369a3c063e52250f3f0061d
97
-
```
87
+
98
88
99
89
You can check [*MDN* BigInt compatibility table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#Browser_compatibility) to know which versions of a browser are supported.
100
90
@@ -140,11 +130,7 @@ Kita akan mengcover string lebih dalam di bab <info:string>.
140
130
```smart header="Tidak ada tipe *character*."
141
131
Dalam beberapa bahasa, ada tipe "character" spesial untuk karakter tunggal. Misalnya, di bahasa C dan di Java adalah `char`.
142
132
143
-
<<<<<<<HEAD
144
133
Di JavaScript, tak ada tipe semacam itu. Cuma ada satu tipe: `string`. String bisa berisi satu karakter atau lebih.
145
-
=======
146
-
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.
147
-
>>>>>>> 58f6599df71b8d50417bb0a52b1ebdc995614017
148
134
```
149
135
150
136
## Boolean (tipe logika)
@@ -272,7 +258,6 @@ Tiga baris terakhir mungkin butuh penjelasan tambahan:
272
258
273
259
Ada 7 tipe data dasar dalam JavaScript.
274
260
275
-
<<<<<<< HEAD
276
261
-`number` untuk nomor dengan bentuk apapun: integer ataupun nilai yang memiliki nilai desimal, batas dari integer adalah ±2<sup>53</sup>.
277
262
-`bigint` untuk nomor integer yang sangat panjang.
278
263
-`string` untuk string. Sebuah string mungkin memiliki 0 atau lebih karakter, tidak ada tipe data untuk string yang memiliki panjang 1 karakter.
@@ -281,16 +266,6 @@ Ada 7 tipe data dasar dalam JavaScript.
281
266
-`undefined` untuk nilai yang tidak ada atau tidak diberikan nilai -- sebuah tipe data mandiri yang memiliki satu nilai yaitu `null`.
282
267
-`object` untuk struktur data yang lebih rumit.
283
268
-`symbol` untuk identifier atau pengenal yang unik.
284
-
=======
285
-
- `number` for numbers of any kind: integer or floating-point, integers are limited by <code>±(2<sup>53</sup>-1)</code>.
286
-
- `bigint` is for integer numbers of arbitrary length.
287
-
- `string` for strings. A string may have zero or more characters, there's no separate single-character type.
288
-
-`boolean`for`true`/`false`.
289
-
-`null`for unknown values -- a standalone type that has a single value `null`.
290
-
-`undefined`for unassigned values -- a standalone type that has a single value `undefined`.
291
-
-`object`for more complex data structures.
292
-
-`symbol`for unique identifiers.
293
-
>>>>>>> ff152b126ec70a9de919bfdc1913215539d37187
294
269
295
270
Operator `typeof` memungkinkan kita melihat tipe mana yang disimpan dalam variable.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/06-alert-prompt-confirm/article.md
-5Lines changed: 0 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,13 +30,8 @@ Ia menampilkan modal window dengan pesan teks, input field untuk pengunjung, dan
30
30
`default`
31
31
: Parameter kedua opsional, nilai inisial untuk input field.
32
32
33
-
<<<<<<< HEAD
34
33
```smart header="Kurung siku didalam sintaks `[...]`"
35
34
Kurung siku di sintaks `default` di kode sintaks di atas menandakan bahwa parameter itu bersifat opsional, tidak benar-benar dibutuhkan.
36
-
=======
37
-
```smart header="The square brackets in syntax `[...]`"
38
-
The square brackets around `default` in the syntax above denote that the parameter is optional, not required.
39
-
>>>>>>> ff152b126ec70a9de919bfdc1913215539d37187
40
35
```
41
36
42
37
Pengunjung halaman bisa mengetik sesuatu didalam kotak prompt dan menekan tombol OK. Lalu kita akan mendapatkan teksnya didalam `result`. Atau pengunjung halaman bisa membatalkan kotak promp dengan menekan *Cancel* atau menekan `key:Esc` pada *keyboard*, lalu kita akan mendapatkan `null` sebagai `result`.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/09-comparison/article.md
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,13 +57,7 @@ algoritma untuk membandingkan dua string sederhana:
57
57
4. Ulangi sampai string berakhir.
58
58
5. Jika kedua string berakhir pada panjang yang sama, maka mereka sama. Sebaliknya, string lebih panjang yang lebih besar.
59
59
60
-
<<<<<<< HEAD
61
60
Pada contoh di atas, pembandingan `'Z' > 'A'` menghasilkan pada langkah pertama sedangkan string `"Glow"` dan `"Glee"` dibandingkan karakter-demi-karakter:
62
-
=======
63
-
In the first example above, the comparison `'Z' > 'A'` gets to a result at the first step.
64
-
65
-
The second comparison `'Glow'` and `'Glee'` needs more steps as strings are compared character-by-character:
0 commit comments