Skip to content

Commit f84d49d

Browse files
committed
translation of all task.md and solution.md in Constructor, operator 'new' are done, according to #1 (comment)
1 parent cda9228 commit f84d49d

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

1-js/04-object-basics/06-constructor-new/1-two-functions-one-object/solution.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Yes, it's possible.
1+
Ya, hal itu memungkinkan.
22

3-
If a function returns an object then `new` returns it instead of `this`.
3+
Jika sebuah fungsi mengembalikan sebuah objek lalu `new` mengembalikan objek tersebut sebagai ganti `this`.
44

5-
So they can, for instance, return the same externally defined object `obj`:
5+
Jadi fungsi tersebut dapat, misalnya, mengembalikan objek `obj` yang secara eksternal didefinisikan sama:
66

77
```js run no-beautify
88
let obj = {};

1-js/04-object-basics/06-constructor-new/1-two-functions-one-object/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 2
22

33
---
44

5-
# Two functionsone object
5+
# Dua fungsisatu objek
66

7-
Is it possible to create functions `A` and `B` such as `new A()==new B()`?
7+
Apakah mungkin untuk membuat fungsi `A` dan fungsi `B` seperti `new A()==new B()`?
88

99
```js no-beautify
1010
function A() { ... }
@@ -16,4 +16,4 @@ let b = new B;
1616
alert( a == b ); // true
1717
```
1818

19-
If it is, then provide an example of their code.
19+
Jika bisa, berikan contoh kodenya.

1-js/04-object-basics/06-constructor-new/2-calculator-constructor/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# Create new Calculator
5+
# Buat Kalkulator baru
66

7-
Create a constructor function `Calculator` that creates objects with 3 methods:
7+
Buatlah sebuah fungsi konstruktor `Calculator` that creates objects with 3 methods:
88

99
- `read()` asks for two values using `prompt` and remembers them in object properties.
1010
- `sum()` returns the sum of these properties.

1-js/04-object-basics/06-constructor-new/3-accumulator/task.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ importance: 5
22

33
---
44

5-
# Create new Accumulator
5+
# Membuat Akumulator baru
66

7-
Create a constructor function `Accumulator(startingValue)`.
7+
Buatlah sebuah fungsi konstruktor `Accumulator(startingValue)`.
88

9-
Object that it creates should:
9+
Objek yang dibuat fungsi tersebut harus:
1010

11-
- Store the "current value" in the property `value`. The starting value is set to the argument of the constructor `startingValue`.
12-
- The `read()` method should use `prompt` to read a new number and add it to `value`.
11+
- Menyimpan "nilai yang sekarang" dalam `value` properti. Nilai awal diatur menjadi argumen konstruktor `startingValue`.
12+
- Metode `read()` harus menggunakan `prompt` untuk membaca sebuah angka dan menambahkannya ke `value`.
1313

14-
In other words, the `value` property is the sum of all user-entered values with the initial value `startingValue`.
14+
Dalam kata lain, properti `value` adalah hasil penjumlahan dari semua nilai yang dimasukkan oleh pengguna dengan nilai awal `startingValue`.
1515

16-
Here's the demo of the code:
16+
Berikut ini contoh kodenya:
1717

1818
```js
19-
let accumulator = new Accumulator(1); // initial value 1
19+
let accumulator = new Accumulator(1); // nilai awal 1
2020

21-
accumulator.read(); // adds the user-entered value
22-
accumulator.read(); // adds the user-entered value
21+
accumulator.read(); // menambahkan nilai yang dimasukkan oleh pengguna
22+
accumulator.read(); // menambahkan nilai yang dimasukkan oleh pengguna
2323

24-
alert(accumulator.value); // shows the sum of these values
24+
alert(accumulator.value); // menampilkan jumlah dari kedua nilai
2525
```
2626

2727
[demo]

0 commit comments

Comments
 (0)