Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
347 commits
Select commit Hold shift + click to select a range
4f6356b
Merge pull request #5 from javascript-tutorial/master
aniketkudale Feb 20, 2020
dd4d218
Copy and paste mistake
Feb 20, 2020
188f497
"better to demonstrate" -> "best demonstrated", ", like this:" -> ":"
paroche Feb 21, 2020
2f066b4
Update article.md
bibin765 Feb 22, 2020
169389f
Some missing whitespaces
Feb 22, 2020
33c2a4e
Update article.md
leviding Feb 23, 2020
87d03ce
Merge pull request #1768 from leviding/patch-3
iliakan Feb 23, 2020
d0ad658
Merge pull request #1767 from u-n-known/patch-4
lex111 Feb 23, 2020
405150f
Merge pull request #1766 from bibin765/master
lex111 Feb 23, 2020
1c1b8a0
small typo fix
jorishr Feb 24, 2020
81ea420
Fix typo
detinsley1s Feb 26, 2020
0307fcb
Fix typo
YRFT Feb 29, 2020
2abe375
Add commas non-terminal properties
duongdominhchau Feb 29, 2020
6c8433e
Update article.md
paroche Feb 29, 2020
131016b
Update article.md
paroche Feb 29, 2020
7550fd5
Merge pull request #1777 from javascript-tutorial/paroche-patch-19
paroche Feb 29, 2020
177f4b3
Update article.md
paroche Feb 29, 2020
8812070
"allows to" -> "allows us to" (2x)
paroche Feb 29, 2020
c039f04
Update article.md
leviding Feb 29, 2020
637088d
Remove useless spaces
alexgalkin Feb 29, 2020
fafee0e
Fix typo.
larryng Mar 1, 2020
4e04bcb
Merge pull request #6 from javascript-tutorial/master
aniketkudale Mar 1, 2020
c72cca8
minor fixes
iliakan Mar 1, 2020
4325537
corrected order for subtraction
zeel Mar 1, 2020
cf6821e
minor fixes
Violet-Bora-Lee Mar 1, 2020
4a15b96
Merge pull request #1783 from Violet-Bora-Lee/patch-1
iliakan Mar 1, 2020
fcfef6a
Merge pull request #1782 from zeel/patch-1
iliakan Mar 1, 2020
696eda5
fix typo
KuthumiPepple Mar 3, 2020
131c96e
fix: removed , from solution.md date data types
zeel Mar 7, 2020
8ae11cb
fix: removed , from task.md date data types
zeel Mar 7, 2020
79356bb
Merge pull request #7 from javascript-tutorial/master
aniketkudale Mar 7, 2020
76bf5ec
Corrected Grammar
aniketkudale Mar 9, 2020
3673751
Fix typo
lex111 Mar 10, 2020
3b48dee
Fix a typo
zhang1pr Mar 11, 2020
6ee0d97
Fix a typo
zhang1pr Mar 11, 2020
6917305
fix: 2 lines of russian to english and a typo (mathces -> matches)
HynekS Mar 11, 2020
61bd2b3
fix: fix markdown highlight
Mar 11, 2020
8a13b9b
Create index.html
leviding Mar 12, 2020
be02f57
Update index.html
leviding Mar 12, 2020
4df68f5
Update index.html
leviding Mar 12, 2020
44e88b8
Update solution.md
leviding Mar 12, 2020
07bd724
Update article.md
leviding Mar 13, 2020
958cbe7
minor fixes
Violet-Bora-Lee Mar 13, 2020
c116813
Merge pull request #1800 from Violet-Bora-Lee/master
iliakan Mar 14, 2020
b93cf9d
Minor statement change
Etheraex Mar 14, 2020
bfe8e3f
Update article.md
leviding Mar 19, 2020
94b9c9d
minor fixes
iliakan Mar 21, 2020
fe5d6d9
Merge pull request #1765 from u-n-known/patch-3
iliakan Mar 21, 2020
63518dc
Merge pull request #1770 from jorishr/patch-1
iliakan Mar 21, 2020
58d4329
Merge pull request #1771 from detinsley1s/patch-1
iliakan Mar 21, 2020
d9d2127
Merge pull request #1774 from duongdominhchau/patch-1
iliakan Mar 21, 2020
0d0908f
Merge pull request #1776 from YRFT/patch-1
iliakan Mar 21, 2020
4939a18
Merge pull request #1779 from leviding/patch-3
iliakan Mar 21, 2020
cf851b0
Merge pull request #1780 from alexgalkin/master
iliakan Mar 21, 2020
8211dfd
Merge pull request #1781 from larryng/patch-1
iliakan Mar 21, 2020
4995823
Merge pull request #1787 from KuthumiPepple/patch-1
iliakan Mar 21, 2020
81e728c
Merge pull request #1789 from zeel/patch-1
iliakan Mar 21, 2020
b7dc89a
closes #1791
iliakan Mar 21, 2020
d19401e
Merge pull request #1792 from aniketkudale/master
iliakan Mar 21, 2020
3c2b027
Merge pull request #1795 from zhang1pr/master
iliakan Mar 21, 2020
3086efe
Merge pull request #1796 from HynekS/fix-lang-and-typo
iliakan Mar 21, 2020
2526d5c
Merge pull request #1797 from xin-nie/xnie-fix-markdown
lex111 Mar 21, 2020
60d2e2f
Merge pull request #1804 from leviding/patch-6
lex111 Mar 21, 2020
4357ba9
fixes #1794
iliakan Mar 21, 2020
cec58f4
Merge pull request #1802 from Etheraex/master
iliakan Mar 21, 2020
4084746
Merge pull request #1799 from leviding/patch-5
iliakan Mar 21, 2020
d2ac997
Merge pull request #1798 from leviding/patch-4
iliakan Mar 21, 2020
6ec3f34
closes #1794
iliakan Mar 22, 2020
c866c46
Update solution.md
leviding Mar 22, 2020
a11cc18
Merge pull request #1807 from leviding/patch-4
iliakan Mar 22, 2020
460e7a8
Update article.md
leviding Mar 23, 2020
6700835
closes #1808
iliakan Mar 23, 2020
fd81db7
closes #1812
iliakan Mar 24, 2020
162280b
minor fixes
iliakan Mar 24, 2020
9900be9
Edit sentance syntax in closure article
Mar 24, 2020
b38e243
Update solution.md
leviding Mar 24, 2020
ab1b6de
formatting
KennethKinLum Mar 25, 2020
03aa504
Update article.md
leviding Mar 26, 2020
304ae1c
Update article.md
leviding Mar 26, 2020
da3303b
Update article.md
leviding Mar 27, 2020
0903209
fix typo
wonderingabout Mar 27, 2020
14cd9ec
Update article.md
leviding Mar 27, 2020
2efef24
Update article.md
leviding Mar 27, 2020
ab7a186
Update article.md
leviding Mar 28, 2020
35ff499
fix typo
baooab Mar 29, 2020
063bb96
Merge pull request #1829 from baooab/patch-6
lex111 Mar 29, 2020
be80c33
Merge pull request #1827 from leviding/patch-12
lex111 Mar 29, 2020
6d81d3d
Merge pull request #1826 from leviding/patch-11
lex111 Mar 29, 2020
8cf89b3
Merge pull request #1825 from wonderingabout/fix-typos
lex111 Mar 29, 2020
0895276
Merge pull request #1824 from leviding/patch-10
lex111 Mar 29, 2020
0c5d5d2
Merge pull request #1821 from leviding/patch-8
lex111 Mar 29, 2020
d6ad00f
Merge pull request #1815 from leviding/patch-5
lex111 Mar 29, 2020
c41b8bd
Update article.md
lex111 Mar 29, 2020
20351cb
Merge pull request #1822 from leviding/patch-9
lex111 Mar 29, 2020
c1c5c73
Merge pull request #1748 from GeorgySerga/patch-6
lex111 Mar 29, 2020
09a11ab
Merge pull request #1744 from qdflavel/typos-fix
lex111 Mar 29, 2020
ac5fd8c
Merge pull request #1820 from KennethKinLum/patch-12
lex111 Mar 29, 2020
f4cb058
trick get a new copy of objects/arrays using the spread operator
wonderingabout Mar 29, 2020
c038ef4
Merge pull request #1823 from wonderingabout/trick-deep-copy-spread
paroche Mar 29, 2020
aad6f5e
fix missing js formatting
wonderingabout Mar 29, 2020
42eadf9
Merge pull request #1814 from michael-mcgee/closure-article-edit
iliakan Mar 29, 2020
adfb099
Update article.md
iliakan Mar 29, 2020
62299ed
do the same => do the same thing
paroche Mar 29, 2020
eb546f0
Fixing "sum(1)" instead of "curriedSum(1)" (l. 42)
Aakodal Mar 30, 2020
46b3bf6
Change 'brackets' to 'parentheses'
paroche Mar 31, 2020
2a6e87a
Change 'brackets' to 'parentheses'
paroche Mar 31, 2020
8e22d3f
Update article.md
leviding Apr 1, 2020
6b5a524
fix an anchor link error
Ahmed-Magdy-S Apr 1, 2020
a223336
Update article.md
leviding Apr 2, 2020
dd0c195
Merge pull request #1839 from leviding/patch-2
iliakan Apr 2, 2020
fde6d43
Merge pull request #1838 from Ahmed-Magdy-S/patch-1
iliakan Apr 2, 2020
368cc06
Merge pull request #1837 from leviding/patch-1
iliakan Apr 2, 2020
cd2d450
Merge pull request #1834 from Aakodal/patch-1
iliakan Apr 2, 2020
5049c0b
Merge pull request #1830 from wonderingabout/add-js-formatting
iliakan Apr 2, 2020
6f45ce7
Merge pull request #1809 from leviding/patch-4
iliakan Apr 2, 2020
a55b99c
fixes #1836
iliakan Apr 2, 2020
d84673a
closes #1810
iliakan Apr 2, 2020
81a63cf
fix minor typo
Ahmed-Magdy-S Apr 2, 2020
0287fbd
Change switch Grouping of "case" example
SambaLim Apr 2, 2020
f33dc7e
Merge pull request #1841 from SambaLim/master
iliakan Apr 3, 2020
09404a0
Merge pull request #1840 from Ahmed-Magdy-S/patch-2
iliakan Apr 3, 2020
b82443d
Update article.md
leviding Apr 4, 2020
5a9b8a4
up
iliakan Apr 4, 2020
2acd258
minor fixes
iliakan Apr 4, 2020
23ffde7
minor fixes
iliakan Apr 4, 2020
59d791b
fix typo
baooab Apr 5, 2020
c89ddc5
Merge pull request #1751 from u-n-known/patch-1
iliakan Apr 5, 2020
ee69981
Update article.md
leviding Apr 6, 2020
ec9c76c
Update article.md
leviding Apr 9, 2020
1e092a8
Update article.md
leviding Apr 9, 2020
8090aa6
Update article.md
leviding Apr 9, 2020
2a01424
chapter -> article (3x)
paroche Apr 10, 2020
0bf13ec
Update article.md
leviding Apr 10, 2020
3ffab46
Update article.md
leviding Apr 11, 2020
71120d5
Various small wording and punctuation changes
paroche Apr 12, 2020
e8dcfd1
Update article.md
leviding Apr 13, 2020
37107f7
Merge pull request #1845 from baooab/patch-7
lex111 Apr 18, 2020
641dd56
delete extra content
baooab Apr 21, 2020
d65141d
That's a getter/setter for it -> It's a getter/setter for it
paroche Apr 22, 2020
00cc802
Remove unnecessary "to"
bryik Apr 26, 2020
ec9ae12
add break to number case
janina213 Apr 29, 2020
f2a099b
Merge pull request #1877 from janina213/patch-1
iliakan Apr 29, 2020
8564508
Merge pull request #1874 from bryik/patch-1
iliakan Apr 29, 2020
6ead9af
Merge pull request #1868 from baooab/patch-8
iliakan Apr 29, 2020
fbd6c8a
Merge pull request #1750 from galunni/patch-1
iliakan Apr 29, 2020
649ecc5
closes #1864
iliakan Apr 29, 2020
1d10422
Merge pull request #1861 from leviding/patch-11
iliakan Apr 29, 2020
2ae8261
Merge pull request #1858 from leviding/patch-10
iliakan Apr 29, 2020
2f61147
Merge pull request #1857 from leviding/patch-9
iliakan Apr 29, 2020
839e375
Merge pull request #1856 from leviding/patch-8
iliakan Apr 29, 2020
3543d6d
Merge pull request #1855 from leviding/patch-7
iliakan Apr 29, 2020
f0bd80c
Merge pull request #1853 from leviding/patch-6
iliakan Apr 29, 2020
ba88b60
closes #1852
iliakan Apr 29, 2020
e1469e3
Merge pull request #1847 from leviding/patch-5
iliakan Apr 29, 2020
889913d
Merge pull request #1844 from leviding/patch-3
iliakan Apr 29, 2020
da16159
trick: use array destructuring to swap variables
wonderingabout Apr 29, 2020
ef71488
Merge pull request #1859 from wonderingabout/trick-swap-variables
iliakan Apr 29, 2020
3a3086b
minor fixes
iliakan Apr 29, 2020
175aefa
minor fixes
iliakan Apr 30, 2020
9c2cb1b
Fix minor typo error
leviding May 1, 2020
29ac929
Fix typo in css-animations
traxium May 1, 2020
5a6be36
Updated to show Edge now supports BigInt
RyanAmeri May 1, 2020
8a13c99
Add nullish coalescing to multiple articles, refactor operators, renu…
iliakan May 2, 2020
0835b11
Update article.md
thediveshsoni May 2, 2020
e111aa1
minor improvements
iliakan May 2, 2020
09a964e
'somewhy' -> 'for some reason it'
paroche May 2, 2020
b057341
refactor objects, add optional chaining
iliakan May 3, 2020
c2ce2d4
minor fixes
iliakan May 4, 2020
a5f6a98
small phrase change
matjax May 4, 2020
a211fc9
Update article.md
rjlardizabal May 5, 2020
6853f6a
remove duplicate words
shubham08gupta May 5, 2020
ea39704
small phrase change 1.1
matjax May 5, 2020
fd45b7f
apostrophe
matjax May 5, 2020
b491097
minor fixes
Violet-Bora-Lee May 5, 2020
ac03836
Merge pull request #1888 from Violet-Bora-Lee/master
iliakan May 5, 2020
2289134
Merge pull request #1884 from matjax/master
paroche May 5, 2020
b782700
minor fixes
Violet-Bora-Lee May 6, 2020
405032e
Merge pull request #1890 from Violet-Bora-Lee/master
iliakan May 6, 2020
ba2b7b0
minor
iliakan May 6, 2020
cd5a7e4
fix debounce
iliakan May 6, 2020
80f2bec
fix debounce
iliakan May 6, 2020
844b96a
fix debounce
iliakan May 6, 2020
4584937
minor fixes
iliakan May 6, 2020
0444de2
minor fixes
iliakan May 6, 2020
3440a4e
minor fixes
iliakan May 6, 2020
df6f6be
minor fixes
iliakan May 6, 2020
fc2ba21
minor fixes
iliakan May 6, 2020
9bd640c
minor fixes
iliakan May 6, 2020
6cf15b7
minor fixes
iliakan May 6, 2020
08309a0
minor fixes
iliakan May 6, 2020
83c07e1
minor fixes
iliakan May 6, 2020
c799f28
minor fixes
iliakan May 6, 2020
6b927fc
fixing a typo on line 7
vin18 May 7, 2020
fe78701
fixing a typo on line 431
vin18 May 7, 2020
24224dc
Merge pull request #1893 from vin18/patch-2
iliakan May 7, 2020
f9ad719
Fix Typo in logical operators
mkawi May 8, 2020
e20b1a4
Adding missing 'pattern:'
Aakodal May 8, 2020
0bc8ab6
Fix a small text typo
pedrogpimenta May 8, 2020
62edeb7
Merge pull request #1896 from pedrogpimenta/patch-1
lex111 May 9, 2020
2f400a5
Merge pull request #1887 from shubham08gupta/patch-1
lex111 May 9, 2020
2bd28fe
Merge pull request #1881 from thediveshsoni/patch-1
lex111 May 9, 2020
ebd9a2c
Merge pull request #1878 from leviding/patch-12
lex111 May 9, 2020
681b4fd
Merge pull request #1891 from vin18/patch-1
lex111 May 9, 2020
3cefe91
Merge pull request #1885 from rjlardizabal/patch-1
lex111 May 9, 2020
4927d7a
Merge pull request #1895 from Aakodal/patch-2
lex111 May 9, 2020
681ef7b
Merge pull request #1879 from traxium/steps
lex111 May 9, 2020
a9e5ed5
minor rephrasings
iliakan May 9, 2020
db789a0
minor
iliakan May 9, 2020
6e1e244
pointer api
iliakan May 9, 2020
5d3aa7f
event.button
iliakan May 9, 2020
cca469b
renumber
iliakan May 9, 2020
c056a19
minor fixes
iliakan May 9, 2020
aabbec1
minor fixes
iliakan May 11, 2020
d9d1cfe
Add additional error type-checking examples and use `instanceof` in l…
mattbaker-digital May 15, 2020
befe535
Update task.md
wnleao May 16, 2020
ec77f84
grammar fix: a plain object
wnleao May 16, 2020
c331e44
Merge pull request #1880 from RyanAmeri/master
iliakan May 17, 2020
8a0058d
closes #1882
iliakan May 17, 2020
9353a04
Merge pull request #1894 from mKawi/patch-1
iliakan May 17, 2020
b18ae20
closes #1897
iliakan May 17, 2020
7ef7c5e
Merge pull request #1903 from mattbaker-digital/master
iliakan May 17, 2020
da1d600
minor fixes
iliakan May 17, 2020
c9d84ac
Merge pull request #1905 from kiniggit/master
iliakan May 17, 2020
873e5f7
Merge pull request #1908 from kiniggit/map_set_grammar
iliakan May 17, 2020
fef45af
correct minor error
ZYinMD May 18, 2020
fc8efbf
closes #1909
iliakan May 18, 2020
6c6d5a4
minor fixes
iliakan May 18, 2020
14eb62c
minor fixes
iliakan May 18, 2020
7fc037f
minor fixes
iliakan May 18, 2020
787409b
correct minor error: "имя" is used in place of "name"
ZYinMD May 19, 2020
4e67c0f
Remove duplicate word "soon"
desevoker May 19, 2020
4267d22
minor fixes
iliakan May 21, 2020
77cb06d
Fixed a comment, to reflect changes in the task.
Logan-Schelly May 21, 2020
333cb9d
Fixed minor typos
Logan-Schelly May 21, 2020
bdd936f
fixed grammar
May 23, 2020
3889038
Merge pull request #1912 from ZYinMD/patch-1
iliakan May 23, 2020
43a2b02
Merge pull request #1914 from ZYinMD/patch-2
iliakan May 23, 2020
e7e0fc8
Merge pull request #1915 from desevoker/patch-1
iliakan May 23, 2020
3623cc2
Merge pull request #1917 from Logan-Schelly/master
iliakan May 23, 2020
0da5b2b
Merge pull request #1920 from ekira/patch-1
iliakan May 23, 2020
8613348
Fix typo
GabrieleC May 23, 2020
46daea1
Details on cross-origin requests & credentials
ironsoul0 May 25, 2020
4fe42dd
fixed typos
kumarvaibhav45 May 26, 2020
9141a27
Merge pull request #1922 from GabrieleC/master
iliakan May 27, 2020
e1b44e8
Merge pull request #1927 from kumarvaibhav45/patch-1
iliakan May 27, 2020
4a22c98
Merge pull request #1926 from ironsoul0/patch-1
iliakan May 27, 2020
8c5fa3a
minor fixes
iliakan May 27, 2020
d36675e
minor fixes
iliakan May 27, 2020
cd2c7ce
minor
iliakan May 28, 2020
5991f39
merging all conflicts
iliakan May 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions 1-js/01-getting-started/1-intro/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Mari kita lihat apa yang spesial dari JavaScript, apa saja yang bisa kita buat m

## Apa itu JavaScript?

<<<<<<< HEAD
*JavaScript* awalnya dibuat untuk *"membuat halaman web menjadi hidup"*.
=======
*JavaScript* was initially created to "make web pages alive".
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

Program yang ada dalam bahasa ini disebut *script*. Script ini bisa ditulis langsung ke dalam kode HTML dari sebuah web dan berjalan otomatis saat halaman dimuat.

Expand Down Expand Up @@ -63,7 +67,11 @@ Kemampuan JavaScript yang ada di dalam browser terbatas demi keamanan pengguna.

Contoh keterbatasan tersebut meliputi:

<<<<<<< HEAD
- JavaScript pada halaman web tak boleh membaca/mengubah file semaunya pada hard disk, mengcopy script tersebut, atau mengeksekusi program. Ia tak punya akses langsung ke OS system functions.
=======
- JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS functions.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

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>`.

Expand Down
12 changes: 12 additions & 0 deletions 1-js/02-first-steps/01-hello-world/1-hello-alert/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>

<body>

<script>
alert( "I'm JavaScript!" );
</script>

</body>

</html>
2 changes: 2 additions & 0 deletions 1-js/02-first-steps/01-hello-world/1-hello-alert/solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

[html src="index.html"]
7 changes: 6 additions & 1 deletion 1-js/02-first-steps/01-hello-world/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ Tag `<script>` mengandung kode JavaScript yang otomatis dieksekusi ketika peramb

Tag `<script>` punya beberapa attribut yang jarang dipakai akhir-akhir ini tapi masih bisa ditemukan dalam kode lama:

<<<<<<< HEAD
Atribut `type`: <code>&lt;script <u>type</u>=...&gt;</code>
: Standar HTML lawas, HTML4, mengharuskan script memiliki `type`. Biasanya `type="text/javascript"`. Sekarang sudah tak diperlukan. Selain itu, standar HTML modern, HTML5, menguubah total makna atribut ini. Sekarang, ia bisa digunakan untuk modul JavaScript. Tapi itu topik berat; kita akan membahas modul di bagian lain dari tutorial ini.
=======
The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic, we'll talk about modules in another part of the tutorial.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

Atribut `language`: <code>&lt;script <u>language</u>=...&gt;</code>
: Atribut ini untuk menampilkan bahasa script. Atribut ini tak lagi dibutuhkan karena JavaScript adalah bahasa default. Tak usah menggunakan itu lagi.
Expand Down Expand Up @@ -78,7 +83,7 @@ Di sini, `/path/to/script.js` adalah jalur absolut ke file script dari root siti
Kamu bisa memasang URL penuh juga. Misalnya:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.2.0/lodash.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
```

Untuk menempelkan beberapa script, gunakan tag berlapis:
Expand Down
9 changes: 9 additions & 0 deletions 1-js/02-first-steps/02-structure/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ Tapi itu harus jadi dua pernyataan terpisah, bukan satu. Penyatuan macam ini sal

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.

<<<<<<< HEAD
## Komen
=======
## Comments [#code-comments]
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

Seiring waktu berjalan, program menjadi lebih rumit. Dan dibutuhkan *komen* yang menjelaskan kode apa itu dan kenapa.

Expand Down Expand Up @@ -135,8 +139,13 @@ alert('Hello');
alert('World');
```

<<<<<<< HEAD
```smart header="Gunakan hotkey!"
Di banyak editor, sebaris kode bisa dikomen dengan menekan hotkey `key:Ctrl+/` untuk komen baris-tunggal dan sesuatu macam `key:Ctrl+Shift+/` -- untuk komen multibaris (pilih sepotong kode dan tekan hotkeynya). Untuk Mac, coba `key:Cmd` ketimbang `key:Ctrl`.
=======
```smart header="Use hotkeys!"
In most editors, a line of code can be commented out by pressing the `key:Ctrl+/` hotkey for a single-line comment and something like `key:Ctrl+Shift+/` -- for multiline comments (select a piece of code and press the hotkey). For Mac, try `key:Cmd` instead of `key:Ctrl` and `key:Option` instead of `key:Shift`.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31
```

````warn header="Komen bersarang tidak didukung!"
Expand Down
40 changes: 40 additions & 0 deletions 1-js/02-first-steps/03-strict-mode/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ Misalnya:
...
```

<<<<<<< HEAD
Kita akan mempelajari fungsi (cara mengelompokkan perintah) segera. Melihat ke depan, ingatlah bahwa `"use strict"` bisa ditaruh di depan badan fungsi ketimbang seluruh script. Itu membuat strict mode aktif hanya di dalam fungsi itu. Tapi biasanya, orang memakai itu untuk seluruh script.

=======
Quite soon we're going to learn functions (a way to group commands), so let's note in advance that `"use strict"` can be put at the beginning of a function. Doing that enables strict mode in that function only. But usually people use it for the whole script.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

````warn header="Yakinkan bahwa \"use strict\" berada paling atas"
Pastikan `"use strict"` berada paling atas dari script kamu, kalau tidak strict mode tidak akan aktif.
Expand All @@ -47,11 +51,21 @@ Sekali kita masuk strict mode, tak ada jalan kembali.

## Konsol peramban

<<<<<<< HEAD
Di masa depan, ketika kamu memakai konsol peramban untuk menguji fitur, harap diingat bahwa `use strict` tidak aktif secara default.
=======
When you use a [developer console](info:devtools) to run code, please note that it doesn't `use strict` by default.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

Kadang, ketika menggunakan `use strict`, kamu akan mendapat hasil yang salah.

<<<<<<< HEAD
Kamu bisa menekan `key:Shift+Enter` untuk menginput baris ganda, dan menggunakan `use strict` di paling atas, seperti ini:
=======
So, how to actually `use strict` in the console?

First, you can try to press `key:Shift+Enter` to input multiple lines, and put `use strict` on top, like this:
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

```js
'use strict'; <Shift+Enter untuk baris baru>
Expand All @@ -61,12 +75,17 @@ Kamu bisa menekan `key:Shift+Enter` untuk menginput baris ganda, dan menggunakan

Ini bekerja pada kebanyakan peramban, macam Firefox dan Chrome.

<<<<<<< HEAD
Jika tidak, cara paling terpercaya ialah memastikan `use strict` adalah menginput kode ke dalam console seperti ini:
=======
If it doesn't, e.g. in an old browser, there's an ugly, but reliable way to ensure `use strict`. Put it inside this kind of wrapper:
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

```js
(function() {
'use strict';

<<<<<<< HEAD
// ...kodemu...
})()
```
Expand All @@ -83,3 +102,24 @@ Untuk sekarang, cukup tahu sampai di sini secara umum:
2. Mode ketat aktif dengan menaruh `"use strict"` paling atas dari script atau function. Beberapa fitur bahasa, seperti "classe" dan "module", mengaktifkan mode ketat secara otomatis.
3. Mode ketat didukung semua peramban modern.
4. Kami sarankan selalu mulai script dengan `"use strict"`. Semua contoh di tutorial ini mengasumsikan mode ketat kecuali (sangat jarang) dispesifikasi kebalikannya.
=======
// ...your code here...
})()
```

## Should we "use strict"?

The question may sound obvious, but it's not so.

One could recommend to start scripts with `"use strict"`... But you know what's cool?

Modern JavaScript supports "classes" and "modules" - advanced language structures (we'll surely get to them), that enable `use strict` automatically. So we don't need to add the `"use strict"` directive, if we use them.

**So, for now `"use strict";` is a welcome guest at the top of your scripts. Later, when your code is all in classes and modules, you may omit it.**

As of now, we've got to know about `use strict` in general.

In the next chapters, as we learn language features, we'll see the differences between the strict and old modes. Luckily, there aren't many and they actually make our lives better.

All examples in this tutorial assume strict mode unless (very rarely) specified otherwise.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31
73 changes: 66 additions & 7 deletions 1-js/02-first-steps/05-types/article.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
# Tipe data

<<<<<<< HEAD
Variabel di JavaScript bisa mengandung data apapun. Satu variabel awalnya string bisa berubah jadi angka:
=======
A value in JavaScript is always of a certain type. For example, a string or a number.

There are eight basic data types in JavaScript. Here, we'll cover them in general and in the next chapters we'll talk about each of them in detail.

We can put any type in a variable. For example, a variable can at one moment be a string and then store a number:
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

```js
// no error
let message = "hello";
message = 123456;
```

<<<<<<< HEAD
Bahasa pemrograman yang memperbolehkan hal semacam ini dibsebut "dynamically typed", yang artinya ada tipe data, tapi variabel tak terikat ke tipe data apapun.

Ada tujuh tipe data dasar di JavaScript. Di sini, kita akan mengcover mereka secara umum dan di bab berikutnya kita akan berbicara tentang setiap dari mereka secara detil.
=======
Programming languages that allow such things, such as JavaScript, are called "dynamically typed", meaning that there exist data types, but variables are not bound to any of them.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

## Number

Expand Down Expand Up @@ -64,21 +76,27 @@ Kita akan melihat lebih tentang cara bekerja dengan angka di bab <info:number>.

## BigInt

<<<<<<< HEAD
Di JavaScript, tipe "number" tidak bisa mewakili nilai integer yang lebih dari <code>2<sup>53</sup></code> (atau kurang dari <code>-2<sup>53</sup></code> untuk negatives), itu batasan teknikal yang disebabkan representasi internal mereka. Itu sekitar 16 digit desimal, jadi untuk banyak tujuan limitasi itu bukan masalah, tapi kadang kita butuh butuh big number yang sangat besar, misanya: cryptography or microsecond-precision timestamps.
=======
In JavaScript, the "number" type cannot represent integer values larger than <code>(2<sup>53</sup>-1)</code> (that's `9007199254740991`), or less than <code>-(-2<sup>53</sup>-1)</code> for negatives. It's a technical limitation caused by their internal representation.

For most purposes that's quite enough, but sometimes we need really big numbers, e.g. for cryptography or microsecond-precision timestamps.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

`BigInt` type was recently added to the language to represent integers of arbitrary length.

A `BigInt` is created by appending `n` to the end of an integer literal:
A `BigInt` value is created by appending `n` to the end of an integer:

```js
// the "n" at the end means it's a BigInt
const bigInt = 1234567890123456789012345678901234567890n;
```

As `BigInt` numbers are rarely needed, we devoted them a separate chapter <info:bigint>.
As `BigInt` numbers are rarely needed, we don't cover them here, but devoted them a separate chapter <info:bigint>. Read it when you need such big numbers.

```smart header="Compatability issues"
Right now `BigInt` is supported in Firefox and Chrome, but not in Safari/IE/Edge.
Right now `BigInt` is supported in Firefox/Chrome/Edge, but not in Safari/IE.
```

## String
Expand Down Expand Up @@ -163,7 +181,11 @@ Di JavaScript, `null` tidak "mereferensi ke objek yang tak ada" atau "null point

Ia cuma nilai spesial yang mewakili "hampa", "kosong" atau "nilai tak-diketahui".

<<<<<<< HEAD
Kode di atas menyatakan bahwa `age` tak diketahui atau kosong untuk beberapa alasan.
=======
The code above states that `age` is unknown.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

## Nilai "undefined"

Expand All @@ -174,30 +196,50 @@ Arti `undefined` ialah "nilai yang tak ditetapkan".
Jika variabel dideklarasi, namun tak ditetapkan, maka nilainya `undefined`:

```js run
let x;
let age;

<<<<<<< HEAD
alert(x); // menampilkan "undefined"
```

Secara teknis, mungkin saja menetapkan `undefined` ke variabel apapun:
=======
alert(age); // shows "undefined"
```

Technically, it is possible to explicitly assign `undefined` to a variable:
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

```js run
let x = 123;
let age = 100;

x = undefined;
// change the value to undefined
age = undefined;

alert(x); // "undefined"
alert(age); // "undefined"
```

<<<<<<< HEAD
...Tapi kita tidak menyarankan itu. Normalnya, kita gunakan `null` untuk menetapkan nilai "kosong" atau "tak-diketahui" ke variabel, dan kita gunakan `undefined` untuk pengecekan seperti melihat apakah variabel telah ditetapkan.
=======
...But we don't recommend doing that. Normally, one uses `null` to assign an "empty" or "unknown" value to a variable, while `undefined` is reserved as a default initial value for unassigned things.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

## Objek dan Simbol

Tipe `object` itu special.

<<<<<<< HEAD
Semua tipe lain disebut "primitive" karena nilainya bisa mengandung sesuatu yang tunggal (bisa jadi string atau angka atau apapun). Sebaliknya, objek digunakan untuk menyimpan koleksi data dan entitas lebih rumit. Kita akan berhadapan dengannya nanti di bab <info:object> setelah kita belajar tentang primitive.

Tipe `symbol` digunakan untuk membuat identifier unik untuk objek. Kita harus menyebutkannya demi kelengkapan, tapi kita akan mempelajarinya setelah objek.
=======
All other types are called "primitive" because their values can contain only a single thing (be it a string or a number or whatever). In contrast, objects are used to store collections of data and more complex entities.

Being that important, objects deserve a special treatment. We'll deal with them later in the chapter <info:object>, after we learn more about primitives.

The `symbol` type is used to create unique identifiers for objects. We have to mention it here for the sake of completeness, but also postpone the details till we know objects.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

## Operator typeof [#type-typeof]

Expand Down Expand Up @@ -240,14 +282,21 @@ typeof alert // "function" (3)

Tiga baris terakhir mungkin butuh penjelasan tambahan:

<<<<<<< HEAD
1. `Math` ialah objek built-in yang menyediakan operasi matematik. Kita akan belajar itu di bab <info:number>. Di sini, ia cuma sekedar contoh dari objek.
2. Hasil `typeof null` yaitu `"object"`. Itu salah. Ia merupakan error yang terkenal resmi dalam `typeof`, yang dijaga untuk kompatibilitas. Tentu saja, `null` bukanlah objek. Ia merupakan nilai spesial dengan tipe terpisah miliknya sendiri. Jadi, lagi, ini merupakan error dalam bahasa.
3. Hasil dari `typeof alert` yaitu `"function"`, karena `alert` merupakan fungsi. Kita akan belajar fungsi di bab berikutnya di mana kita juga akan melihat bahwa tak ada tipe "fungsi" spesial di JavaScript. Fungsi merupakan bagian dari tipe objek. Tapi `typeof` memperlakukan mereka secara berbeda, yang mengembalikan `"fungsi"`. Itu tak sepenuhnya benar, tapi sangat nyaman pada praktiknya.
=======
1. `Math` is a built-in object that provides mathematical operations. We will learn it in the chapter <info:number>. Here, it serves just as an example of an object.
2. The result of `typeof null` is `"object"`. That's an officially recognized error in `typeof` behavior, coming from the early days of JavaScript and kept for compatibility. Definitely, `null` is not an object. It is a special value with a separate type of its own.
3. The result of `typeof alert` is `"function"`, because `alert` is a function. We'll study functions in the next chapters where we'll also see that there's no special "function" type in JavaScript. Functions belong to the object type. But `typeof` treats them differently, returning `"function"`. That also comes from the early days of JavaScript. Technically, such behavior isn't correct, but can be convenient in practice.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

## Kesimpulan

Ada 7 tipe data dasar dalam JavaScript.

<<<<<<< HEAD
- `number` untuk angka jenis manapun: integer atau floating-point.
- `bigint` untuk angka integer dengan panjang sembarang.
- `string` untuk string. String mungkin punya satu atau lebih karakter, tak ada tipe katakter tunggal terpisah.
Expand All @@ -256,6 +305,16 @@ Ada 7 tipe data dasar dalam JavaScript.
- `undefined` untuk nilai yang belum ditetapkan -- tipe mandiri yang punya nilai tunggal `undefined`.
- `object` untuk struktur data lebih rumit.
- `symbol` untuk identifier unik.
=======
- `number` for numbers of any kind: integer or floating-point, integers are limited by ±2<sup>53</sup>.
- `bigint` is for integer numbers of arbitrary length.
- `string` for strings. A string may have zero or more characters, there's no separate single-character type.
- `boolean` for `true`/`false`.
- `null` for unknown values -- a standalone type that has a single value `null`.
- `undefined` for unassigned values -- a standalone type that has a single value `undefined`.
- `object` for more complex data structures.
- `symbol` for unique identifiers.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31

Operator `typeof` memungkinkan kita melihat tipe mana yang disimpan dalam variable.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Interaksi: alert, prompt, confirm

<<<<<<< HEAD:1-js/02-first-steps/09-alert-prompt-confirm/article.md
Di bagian tutorial ini kita membahas bahasa JavaScript "apa adanya", tanpa tweak ke lingkungan tertentu.

Tapi kita masih akan memakai peramban sebagai lingkungan demo kita, jadi kita sebaiknya paham minimal beberapa fungsi user-interface-nya. Di bab ini, kita akan berkenalan dengan fungsi browser `alert`, `prompt` dan `confirm`.
Expand All @@ -13,14 +14,25 @@ alert(message);
```

Ini menampilkan pesan dan menyela exekusi script hingga pengguna menekan "OK".
=======
As we'll be using the browser as our demo environment, let's see a couple of functions to interact with the user: `alert`, `prompt` and `confirm`.

## alert

This one we've seen already. It shows a message and waits for the user to presses "OK".
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31:1-js/02-first-steps/06-alert-prompt-confirm/article.md

Misalnya:

```js run
alert("Hello");
```

<<<<<<< HEAD:1-js/02-first-steps/09-alert-prompt-confirm/article.md
Mini-window dengan pesan ini disebut *modal window*. Kata "modal" artinya pengunjung tak bisa berinteraksi dengan apapun di laman, menekan tombol lain, dll. hingga mereka selesai berurusan dengan window ini. Dalam hal ini -- hingga mereka menekan "OK".
=======
The mini-window with the message is called a *modal window*. The word "modal" means that the visitor can't interact with the rest of the page, press other buttons, etc, until they have dealt with the window. In this case -- until they press "OK".
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31:1-js/02-first-steps/06-alert-prompt-confirm/article.md

## prompt

Expand All @@ -38,7 +50,15 @@ Ia menampilkan modal window dengan pesan teks, input field untuk pengunjung, dan
`default`
: Parameter kedua opsional, nilai inisial untuk input field.

<<<<<<< HEAD:1-js/02-first-steps/09-alert-prompt-confirm/article.md
Pengunjung boleh menulis apapun di input field prompt dan menekan OK. Atau mereka bisa membatalkan input dengan menekan Cancel atau menekan tombol `key:Esc`.
=======
```smart header="The square brackets in syntax `[...]`"
The square brackets around `default` in the syntax above denote that the parameter as optional, not required.
```

The visitor can type something in the prompt input field and press OK. Then we get that text in the `result`. Or they can cancel the input by pressing Cancel or hitting the `key:Esc` key, then we get `null` as the `result`.
>>>>>>> cd2c7ce3c8f033e6f7861ed1b126552e41ba3e31:1-js/02-first-steps/06-alert-prompt-confirm/article.md

Panggilan ke `prompt` mengembalikan teks dari input field atau `null` jika input dibatalkan.

Expand Down
Loading