Skip to content

Commit 8b0d693

Browse files
committed
merging all conflicts
2 parents e594d67 + 3d7abb9 commit 8b0d693

File tree

236 files changed

+6281
-561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+6281
-561
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: iliakan

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ sftp-config.json
2121
Thumbs.db
2222

2323

24+
/svgs

1-js/01-getting-started/1-intro/article.md

+67
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,44 @@ Browser punya engine yang tertanam didalamnya yang disebut "JavaScript virtual m
2424

2525
Tiap engine punya *codename*-nya sendiri. Misalnya:
2626

27+
<<<<<<< HEAD
2728
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- di Chrome dan Opera.
2829
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- di Firefox.
2930
- ...Ada juga codename lain seperti "Trident" dan "Chakra" untuk versi berbeda dari IE, "ChakraCore" untuk Microsoft Edge, "Nitro" dan "SquirrelFish" untuk Safari, dll.
3031

3132
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.
33+
=======
34+
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge.
35+
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
36+
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc.
37+
38+
The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome, Opera and Edge.
39+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
3240
3341
```smart header="Bagaimana engine bekerja?"
3442
3543
Engine sangat rumit. Tapi basicnya mudah.
3644
45+
<<<<<<< HEAD
3746
1. Engine (tertanam jika ia sebuah browser)bisa membaca ("memparsing") script.
3847
2. Lalu ia mengkonversi ("mengkompilasi") script tersebut menjadi bahasa mesin.
3948
3. Dan kemudian kode mesin berjalan, lumayan cepat.
49+
=======
50+
1. The engine (embedded if it's a browser) reads ("parses") the script.
51+
2. Then it converts ("compiles") the script to machine code.
52+
3. And then the machine code runs, pretty fast.
53+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
4054
4155
Engine melakukan optimisasi di setiap langkah proses. Dia bahkan memperhatikan script yang telah dikompilasi saat sedang berjalan, menganalisa data yang mengalir di dalam, dan melakukan optimisasi ke kode mesin berdasarkan pengetahuan itu.
4256
```
4357

4458
## Apa yang bisa dilakukan *in-browser JavaScript*?
4559

60+
<<<<<<< HEAD
4661
JavaScript modern merupakan bahasa pemrograman yang "aman". Ia tidak menyebabkan akses tingkat-rendah ke memory atau CPU, karena memang awalnya dibuat untuk browser, yang tentunya tidak membutuhkan hal tersebut.
62+
=======
63+
Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or the CPU, because it was initially created for browsers which do not require it.
64+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
4765
4866
Kemampuan JavaScript sangat tergantung pada lingkungan tempat ia berjalan. Misalnya, [Node.js](https://wikipedia.org/wiki/Node.js) mendukung function yang memungkingkan JavaScript melakukan baca/tulis file apapun, melakukan permintaan jaringan, dsb.
4967

@@ -59,14 +77,19 @@ Misalnya, *in-browser JavaScript* mampu:
5977

6078
## Apa yang TIDAK BISA dilakukan *in-browser JavaScript*?
6179

80+
<<<<<<< HEAD
6281
Kemampuan JavaScript yang ada di dalam browser terbatas demi keamanan pengguna. Tujuannya supaya mencegah halaman web berbahya mengakses informasi pribadi atau merusak data pengguna.
82+
=======
83+
JavaScript's abilities in the browser are limited to protect the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
84+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
6385
6486
Contoh keterbatasan tersebut meliputi:
6587

6688
- Javascript didalam sebuah halaman web seharusnya tidak dapat membaca/mengubah file didalam hardisk semaunya.
6789

6890
Browser-browser modern memperbolehkan JavaScript mengakses file, tapi aksesnya dibatasi dan tersedia hanya jika pengguna melakukan hal tertentu, misalnya seperti "menjatuhkan" file ke dalam jendela browser atau memilih file via tag `<input>`.
6991

92+
<<<<<<< HEAD
7093
Ada beberapa cara untuk berinteraksi dengan kamera/mikrofon dan perangkat-perangkat lainnya, namun mereka butuh ijin khusus pengguna. Jadi sebuah halaman yang memiliki JavaScript tidak bisa mengaktifkan web-camera, memantau sekeliling dan mengirim informasinya ke [NSA] secara diam-diam(https://en.wikipedia.org/wiki/National_Security_Agency).
7194
- Tab/jendela yang berbeda umumnya tidak ada hubungan sama sekali. Terkadang jendela yang berbeda bisa saling berhubungan juga, misalnya ketika satu jendela menggunakan JavaScript untuk membuka jendela lainnya. Tapi meski demikian, JavaScript dari suatu halaman tak boleh mengakses halaman lainnya jika mereka berasal dari situs yang berbeda (dari domain, protokol, atau port berbeda).
7295

@@ -78,34 +101,62 @@ Contoh keterbatasan tersebut meliputi:
78101
![](limitations.svg)
79102

80103
Pembatasan macam ini tidak ada jika JavaScript digunakan di luar browser, misalnya di server. Browser-browser modern juga memperbolehkan plugin/ekstensi yang membutuhkan ijin tambahan.
104+
=======
105+
There are ways to interact with the camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
106+
- Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other page if they come from different sites (from a different domain, protocol or port).
107+
108+
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and must contain special JavaScript code that handles it. We'll cover that in the tutorial.
109+
110+
This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com`, for example, and steal information from there.
111+
- JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
112+
113+
![](limitations.svg)
114+
115+
Such limitations do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugins/extensions which may ask for extended permissions.
116+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
81117
82118
## Apa yang membuat JavaScript unik?
83119

84120
Paling tidak ada *tiga* hal unik dari JavaScript:
85121

86122
```compare
123+
<<<<<<< HEAD
87124
+ Integrasi penuh dengan HTML/CSS.
88125
+ Hal sederhana diselesaikan dengan sederhana.
89126
+ Dukungan dari mayoritas web browser dan aktif secara default.
127+
=======
128+
+ Full integration with HTML/CSS.
129+
+ Simple things are done simply.
130+
+ Supported by all major browsers and enabled by default.
131+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
90132
```
91133
JavaScript merupakan satu-satunya teknologi browser yang mengkombinasikan ketiga poin di atas.
92134

93135
Itulah yang membuat JavaScript unik. Itulah kenapa JavaScript menjadi alat yang paling sering untuk membuat antarmuka browser.
94136

137+
<<<<<<< HEAD
95138
Katanya, JavaScript juga bisa dipakai untuk membuat aplikasi server, mobile, dsb.
139+
=======
140+
That said, JavaScript can be used to create servers, mobile applications, etc.
141+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
96142
97143
## Bahasa "di atas" JavaScript
98144

99145
Sintaks JavaScript tidak memenuhi kebutuhan setiap orang. Masing-masing orang ingin fitur yang berbeda-beda.
100146

101147
Itu wajar, karena proyek dan persyaratan tiap orang berbeda-beda.
102148

149+
<<<<<<< HEAD
103150
Akhir-akhir ini muncul banyak bahasa baru, yang *ditranspile* (dikonversi) ke JavaScript sebelum dijalankan di browser.
151+
=======
152+
So, recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
153+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
104154
105155
Tools modern membuat transpilasi sangat cepat dan transparan, yang memungkinkan para developer menulis kodenya dalam bahasa lain dan mengautokonversi itu "di balik layar".
106156

107157
Contoh bahasa yang dimaksud:
108158

159+
<<<<<<< HEAD
109160
- [CoffeeScript](http://coffeescript.org/) merupakan "syntactic sugar" dari JavaScript. Dia memperkenalkan syntax yang lebih pendek, memungkingkan kita menulis kode lebih bersih dan lebih presisi. Biasanya, Ruby devs menyukainya.
110161
- [TypeScript](http://www.typescriptlang.org/) berfokus pada penambahan "strict data typing" yang menyederhanakan pengembangan dan dukungan sistem yang komplex. Ia dikembangkan oleh Microsoft.
111162
- [Flow](http://flow.org/) juga menambahkan data typing, tapi dalam cara berbeda. Dikembangkan oleh Facebook.
@@ -114,9 +165,25 @@ Contoh bahasa yang dimaksud:
114165
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) adalah sebuah bahasa pemograman modern, ringkas dan aman yang dapat ditargetkan untuk browser atau Node.
115166

116167
Masih banyak lagi. Tentunya, jika kita menggunakan salah satu bahasa yang ditranspile tersebut, kita sebaiknya juga paham JavaScript untuk mengerti apa yang mereka lakukan.
168+
=======
169+
- [CoffeeScript](https://coffeescript.org/) is "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
170+
- [TypeScript](https://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
171+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
172+
- [Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps), but also can be transpiled to JavaScript. Developed by Google.
173+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
174+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
175+
176+
There are more. Of course, even if we use one of these transpiled languages, we should also know JavaScript to really understand what we're doing.
177+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
117178
118179
## Kesimpulan
119180

181+
<<<<<<< HEAD
120182
- JavaScript awalnya diciptakan sebagai bahasa khusus browser, namun sekarang banyak digunakan di lingkungan lain.
121183
- Sekarang, JavaScript mempunyai posisi unik sebagai bahasa browser paling banyak diadopsi dengan integrasi penuh dengan HTML/CSS.
122184
- Ada banyak bahasa yang "ditranspile" ke JavaScript dan menyediakan fitur tertentu. Disarankan untuk mempelajari mereka juga, minimal sebentar, setelah menguasai JavaScript.
185+
=======
186+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
187+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
188+
- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.
189+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6

1-js/01-getting-started/2-manuals-specifications/article.md

+21
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@
22

33
Buku ini adalah _tutorial_. Tujuannya membantu kamu memahami bahasa ini (Javascript) pelan-pelan. Tapi sekali kamu akrab atau familiar dengan dasarnya, kamu juga membutuhkan dari sumber-sumber lain.
44

5+
<<<<<<< HEAD
56
## Spesifikasi
7+
=======
8+
This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other resources.
9+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
610
711
[Spesifikasi ECMA-262](https://www.ecma-international.org/publications/standards/Ecma-262.htm) berisi informasi formal, detil, and mendalam tentang JavaScript. Ia mendefisikan bahasa ini.
812

913
Tapi karena menjadi formal, ia sulit dipahami di awal. Jadi jika kamu butuh sumber informasi terpercaya tentang detil bahasa, spesifikasi ini tempat yang tepat. Tapi ini bukan untuk penggunaan harian.
1014

1115
Versi spesifikasi baru dirilis tiap tahun. Di antara rilis ini, draft spesifikasi terakhir ada di <https://tc39.es/ecma262/>.
1216

17+
<<<<<<< HEAD
1318
Untuk membaca tentang fitur terkini, termasuk yang "hampir menjadi standar" (disebut "stage 3"), lihat proposalnya di <https://github.com/tc39/proposals>.
19+
=======
20+
A new specification version is released every year. Between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
21+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
1422
1523
Juga, jika kamu dalam pengembangan untuk peramban, maka ada spek lain yang dibahas di [bagian kedua](info:browser-environment) di tutorial ini.
1624

@@ -20,20 +28,33 @@ Juga, jika kamu dalam pengembangan untuk peramban, maka ada spek lain yang dibah
2028

2129
Kamu bisa cari di <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
2230

31+
<<<<<<< HEAD
2332
Meski, sering lebih bagus menggunakan pencarian internet. Pakai "MDN [term]" di query, misal <https://google.com/search?q=MDN+parseInt> untuk mencari fungsi `parseInt`.
2433

2534
- **MSDN** – Manual Microsoft dengan banyak informasi, termasuk JavaScript (sering dirujuk sebagai JScript). Jika kamu butuh sesuatu yang spesifik ke Internet Explorer, lebih baik pergi ke: <http://msdn.microsoft.com/>.
35+
=======
36+
You can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
37+
38+
Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for the `parseInt` function.
39+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
2640
2741
Juga, kamu bisa menggunakan pencarian internet dengan frasa seperti "RegExp MSDN" atau "RegExp MSDN jscript".
2842

2943
## Tabel kompatibilitas
3044

3145
JavaScript merupakan bahasa berkembang, fitur baru ditambah secara reguler.
3246

47+
<<<<<<< HEAD
3348
Untuk melihat dukungan mereka pada engine berbasis peramban dan lainnya, lihat:
3449

3550
- <http://caniuse.com> - tabel dukungan per-fitur, misal untuk melihat engine mana yang mendukung fungsi kryptografi modern: <http://caniuse.com/#feat=cryptography>.
3651
- <https://kangax.github.io/compat-table> - tabel dengan fitur dan engine bahasa yang mendukung atau yang tidak mendukung.
52+
=======
53+
- <https://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <https://caniuse.com/#feat=cryptography>.
54+
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
55+
56+
All these resources are useful in real-life development, as they contain valuable information about language details, their support, etc.
57+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
3758
3859
Semua sumber ini berguna di pengembangan nyata, karena mereka berisi informasi berharga tentang detil bahasa, dukungan mereka dll.
3960

1-js/01-getting-started/3-code-editors/article.md

+22
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ Satu IDE meload proyek (yang bisa berupa banyak file), memungkingkan navigasi an
1212

1313
Jika kamu belum memilih satu IDE, pertimbangkan opsi-opsi berikut:
1414

15+
<<<<<<< HEAD
1516
- [Visual Studio Code](https://code.visualstudio.com/) (lintas-platform, gratis).
1617
- [WebStorm](http://www.jetbrains.com/webstorm/) (lintas-platform, berbayar).
18+
=======
19+
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
20+
- [WebStorm](https://www.jetbrains.com/webstorm/) (cross-platform, paid).
21+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
1722
1823
Untuk Windows, ada juga "Visual Studio", jangan dipusingkan dengan "Visual Studio Code." "Visual Studio" merupakan editor khusus Windows yang keren dan berbayar, sangat cocok untuk platform .NET. Ia bagus juga untuk JavaScript. Lalu ada juga versi gratisnya [Visual Studio Community](https://www.visualstudio.com/vs/community/).
1924

@@ -29,18 +34,35 @@ Perbedaan utama antara "editor ringan" dan "IDE" adalah IDE bekerja pada level p
2934

3035
Pada praktiknya, editor ringan bisa punya banyak plugin termasuk syntax analyzers dan autocompleters level direktori, jadi tak ada batasan ketat antara editor ringan dan IDE.
3136

37+
<<<<<<< HEAD
3238
Opsi-opsi berikut patut anda perhatikan:
3339

3440
- [Atom](https://atom.io/) (lintas-platform, gratis).
3541
- [Visual Studio Code](https://code.visualstudio.com/) (lintas-platform, gratis).
3642
- [Sublime Text](http://www.sublimetext.com) (lintas-platform, shareware).
3743
- [Notepad++](https://notepad-plus-plus.org/) (Windows, gratis).
3844
- [Vim](http://www.vim.org/) dan [Emacs](https://www.gnu.org/software/emacs/) sangat keren juga jika kamu tahu cara pakainya.
45+
=======
46+
There are many options, for instance:
47+
48+
- [Sublime Text](https://www.sublimetext.com/) (cross-platform, shareware).
49+
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
50+
- [Vim](https://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
51+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
3952
4053
## Jangan berdebat
4154

4255
Daftar editor di atas merupakan barang yang sudah biasa saya atau teman-teman saya para pengembang profesional gunakan selama ini dengan gembira.
4356

4457
Ada banyak editor bagus lainnya di dunia kita yang besar ini. Silakan pilih satu yang paling kamu suka.
4558

59+
<<<<<<< HEAD
4660
Pilihan editor, sama seperti tool lainnya, bersifat individual dan tergantung pada proyek, kebiasaan, dan preferensi personal.
61+
=======
62+
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
63+
64+
The author's personal opinion:
65+
66+
- I'd use [Visual Studio Code](https://code.visualstudio.com/) if I develop mostly frontend.
67+
- Otherwise, if it's mostly another language/platform and partially frontend, then consider other editors, such as XCode (Mac), Visual Studio (Windows) or Jetbrains family (Webstorm, PHPStorm, RubyMine etc, depending on the language).
68+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6

1-js/02-first-steps/01-hello-world/article.md

+4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ File script ditempel ke HTML dengan atribut `src`:
7373
<script src="/path/to/script.js"></script>
7474
```
7575

76+
<<<<<<< HEAD
7677
Di sini, `/path/to/script.js` adalah jalur absolut ke file script dari root sitius. Kamu juga bisa menyediakan jalur relatif dari laman ini. Misalnya, `src="script.js"` berarti file `"script.js"` dalam folder saat ini.
78+
=======
79+
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"`, just like `src="./script.js"`, would mean a file `"script.js"` in the current folder.
80+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
7781
7882
Kamu bisa memasang URL penuh juga. Misalnya:
7983

1-js/02-first-steps/04-variables/3-uppercast-constant/task.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,24 @@ const birthday = '18.04.1982';
1212
const age = someCode(birthday);
1313
```
1414

15+
<<<<<<< HEAD
1516
Di sini kita punya konstan tanggal `birthday` dan `age` dikalkulasi dari `birthday` dengan batuan beberapa kode (tidak tersedia yang pendek-pendek, dan karena detail tidak masalah di sini).
17+
=======
18+
Here we have a constant `birthday` for the date, and also the `age` constant.
19+
20+
The `age` is calculated from `birthday` using `someCode()`, which means a function call that we didn't explain yet (we will soon!), but the details don't matter here, the point is that `age` is calculated somehow based on the `birthday`.
21+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
1622
1723
Apakah tepat menggunakan huruf kapital untuk `birthday`? Untuk `age`? Atau bahkan untuk keduanya?
1824

1925
```js
26+
<<<<<<< HEAD
2027
const BIRTHDAY = '18.04.1982'; // buat huruf kapital?
2128

2229
const AGE = someCode(BIRTHDAY); // buat huruf kapital?
23-
```
30+
=======
31+
const BIRTHDAY = '18.04.1982'; // make birthday uppercase?
2432

33+
const AGE = someCode(BIRTHDAY); // make age uppercase?
34+
>>>>>>> 3d7abb9cc8fa553963025547717f06f126c449b6
35+
```

0 commit comments

Comments
 (0)