Skip to content

Commit bfaf00a

Browse files
committed
chore(i18n): 1.02.07 partially done
1 parent 1dd99a5 commit bfaf00a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

1-js/02-first-steps/07-operators/article.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,30 +290,30 @@ let a = ++counter; // (*)
290290
alert(a); // *!*2*/!*
291291
```
292292

293-
In the line `(*)`, the *prefix* form `++counter` increments `counter` and returns the new value, `2`. So, the `alert` shows `2`.
293+
Dalam barus `(*)`, bentuk *prefix*`++counter` menginkremen `counter` dan mengembalikan nilai baru, `2`. Jadi, `alert` menampilkan `2`.
294294

295-
Now, let's use the postfix form:
295+
Sekarang, mari kita gunakan bentuk postfix:
296296

297297
```js run
298298
let counter = 1;
299-
let a = counter++; // (*) changed ++counter to counter++
299+
let a = counter++; // (*) ganti ++counter ke counter++
300300
301301
alert(a); // *!*1*/!*
302302
```
303303

304-
In the line `(*)`, the *postfix* form `counter++` also increments `counter` but returns the *old* value (prior to increment). So, the `alert` shows `1`.
304+
Dalam barus `(*)`, bentuk *postfix* `counter++` juga menginkremen `counter` tapi mengembalikan nilai *lama* (sebelum inkremen). Jadi, `alert` menampilkan `1`.
305305

306-
To summarize:
306+
Ringkasnya:
307307

308-
- If the result of increment/decrement is not used, there is no difference in which form to use:
308+
- Jika hasil dari inkremen/dekremen tidak digunakan, tak ada perbedaan bentuk mana yang dipakai:
309309

310310
```js run
311311
let counter = 0;
312312
counter++;
313313
++counter;
314314
alert( counter ); // 2, the lines above did the same
315315
```
316-
- If we'd like to increase a value *and* immediately use the result of the operator, we need the prefix form:
316+
- Jika kita ingin menaikkan nilai *dan* langsung memakai hasil dari operator, kita butuh bentuk prefix:
317317

318318
```js run
319319
let counter = 0;

0 commit comments

Comments
 (0)