Skip to content

Commit 696cdf9

Browse files
committed
feat(i18n): 1.02.16.article
1 parent 43c02ca commit 696cdf9

File tree

1 file changed

+19
-19
lines changed
  • 1-js/02-first-steps/16-javascript-specials

1 file changed

+19
-19
lines changed

1-js/02-first-steps/16-javascript-specials/article.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
1-
# JavaScript specials
1+
# Spesial JavaScript
22

3-
This chapter briefly recaps the features of JavaScript that we've learned by now, paying special attention to subtle moments.
3+
Bab ini secara singkat merekap fitur JavaScript yang sudah kita pelajari sekarang, membayar perhatian khusus ke momen-momen halus.
44

5-
## Code structure
5+
## Struktur kode
66

7-
Statements are delimited with a semicolon:
7+
Pernyataan didelimisi dengan semicolon:
88

99
```js run no-beautify
1010
alert('Hello'); alert('World');
1111
```
1212

13-
Usually, a line-break is also treated as a delimiter, so that would also work:
13+
Biasanya, line-break juga diperlakukan sebagai delimiter, jadi itu juga akan bekerja:
1414

1515
```js run no-beautify
1616
alert('Hello')
1717
alert('World')
1818
```
1919

20-
That's called "automatic semicolon insertion". Sometimes it doesn't work, for instance:
20+
Itu disebut "penyisipan semicolon otomatis". Kadang ia tidak bekerja, misalnya:
2121

2222
```js run
2323
alert("There will be an error after this message")
2424

2525
[1, 2].forEach(alert)
2626
```
2727

28-
Most codestyle guides agree that we should put a semicolon after each statement.
28+
Kebanyakan panduan codestyle setuju bahwa kita sebaiknya menaruh semicolon di tiap akhir pernyataan.
2929

30-
Semicolons are not required after code blocks `{...}` and syntax constructs with them like loops:
30+
Semicolon tak dibutuhkan setelah blok kode `{...}` dan konstruksi syntax dengan mereka yang seperti loop:
3131

3232
```js
3333
function f() {
34-
// no semicolon needed after function declaration
34+
// semicolon tak dibutuhkan setelah deklarasi fungsi
3535
}
3636

3737
for(;;) {
38-
// no semicolon needed after the loop
38+
// semicolon tak dibutuhkan setelah loop
3939
}
4040
```
4141

42-
...But even if we can put an "extra" semicolon somewhere, that's not an error. It will be ignored.
42+
...Tapi meskipun kita taruh semicolon "extra" di suatu tempat, itu bukan galat. Ia akan diabaikan.
4343

44-
More in: <info:structure>.
44+
Lebih lanjut di: <info:structure>.
4545

46-
## Strict mode
46+
## Mode ketat
4747

48-
To fully enable all features of modern JavaScript, we should start scripts with `"use strict"`.
48+
Untuk mengaktifkan penuh semua fitur modern JavaScript, kita sebaiknya mulai script dengan `"use strict"`.
4949

5050
```js
5151
'use strict';
5252

5353
...
5454
```
5555

56-
The directive must be at the top of a script or at the beginning of a function body.
56+
Directive ini harus ada di paling atas script atau di awal badan fungsi.
5757

58-
Without `"use strict"`, everything still works, but some features behave in the old-fashion, "compatible" way. We'd generally prefer the modern behavior.
58+
Tanpa `"use strict"`, apapun akan bekerja, tapi beberapa fitur bersikap dengan cara kuno, "kompatibel". Secara umum kita akan pilih sikap modern.
5959

60-
Some modern features of the language (like classes that we'll study in the future) enable strict mode implicitly.
60+
Beberapa fitur modern bahasa ini (seperti kelas yang akan kita pelajari di kemudian) mengaktifkan mode ketat secara implisit.
6161

62-
More in: <info:strict-mode>.
62+
Lebih lanjut di: <info:strict-mode>.
6363

64-
## Variables
64+
## Variabel
6565

6666
Can be declared using:
6767

0 commit comments

Comments
 (0)