Skip to content

Commit 5679ab0

Browse files
authored
Merge pull request #194 from yoga1234/master
translate
2 parents c4da15d + 856aa5a commit 5679ab0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

1-js/08-prototypes/03-native-prototypes/2-defer-to-prototype-extended/solution.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ function f(a, b) {
1313
alert( a + b );
1414
}
1515

16-
f.defer(1000)(1, 2); // shows 3 after 1 sec
16+
f.defer(1000)(1, 2); // menampilkan 3 setelah 1 detik
1717
```
1818

19-
Please note: we use `this` in `f.apply` to make our decoration work for object methods.
19+
Ingatlah: kita menggunakan `this` didalam `f.apply` untuk membuat dekorasi kita bekerja untuk metode objek.
2020

21-
So if the wrapper function is called as an object method, then `this` is passed to the original method `f`.
21+
Jadi jika pembungkus fungsinya dipanggil sebagai metode objek, maka `this` diberikan kepada metode asli `f`.
2222

2323
```js run
2424
Function.prototype.defer = function(ms) {
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
importance: 4
1+
nilai: 4
22

33
---
44

5-
# Add the decorating "defer()" to functions
5+
# Menambah dekorasi "defer()" ke fungsi.
66

7-
Add to the prototype of all functions the method `defer(ms)`, that returns a wrapper, delaying the call by `ms` milliseconds.
7+
Tambahkan prototype dari semua fungsi metode` defer(ms)`, yang mengembalikan pembungkus, menunda pemanggilan dengan `ms` milidetik.
88

9-
Here's an example of how it should work:
9+
Contoh:
1010

1111
```js
1212
function f(a, b) {
1313
alert( a + b );
1414
}
1515

16-
f.defer(1000)(1, 2); // shows 3 after 1 second
16+
f.defer(1000)(1, 2); // tampilkan 3 setelah 1 detik
1717
```
1818

19-
Please note that the arguments should be passed to the original function.
19+
Perhatikan bahwa argumennya harus diberikan ke fungsi aslinya.

0 commit comments

Comments
 (0)