@@ -1987,19 +1987,21 @@ getdata()
1987
1987
1988
1988
1989
1989
## ** Menyusun Format**
1990
- Formatting is subjective. Like many rules herein, there is no hard and fast
1991
- rule that you must follow. The main point is DO NOT ARGUE over formatting.
1992
- There are [ tons of tools] ( http://standardjs.com/rules.html ) to automate this.
1993
- Use one! It's a waste of time and money for engineers to argue over formatting.
1990
+ Menyusun format adalah subjektif. Seperti aturan disini, tidak ada aturan keras
1991
+ yang harus kamu ikuti. Poin utamanya adalah JANGAN BERDEBAT atas format. Ada
1992
+ [ banyak sekali alat] ( http://standardjs.com/rules.html ) untuk mengotomasi hal ini.
1993
+ Gunakan salah satu! Hal ini adalah pemborosan waktu dan uang engineers untuk
1994
+ berdebat soal format.
1994
1995
1995
- For things that don't fall under the purview of automatic formatting
1996
- (indentation, tabs vs. spaces, double vs. single quotes, etc.) look here
1997
- for some guidance .
1996
+ Untuk hal-hal yang tidak termasuk dalam hal format otomatis (indentasi,
1997
+ tabulasi vs. spasi, ganda vs tanda petik tunggal, dll) lihatlah kesini
1998
+ untuk beberapa bimbingan .
1998
1999
1999
2000
### Gunakan Kapitalisasi yg konsisten
2000
- JavaScript is untyped, so capitalization tells you a lot about your variables,
2001
- functions, etc. These rules are subjective, so your team can choose whatever
2002
- they want. The point is, no matter what you all choose, just be consistent.
2001
+ JavaScript tidak memiliki penggolongan, jadi kapitalisasi memberitahumu banyak
2002
+ tentang variabel, fungsi, dll. Aturan ini adalah subjektif, jadi tim-mu dapat
2003
+ memilih apapun yang mereka inginkan. Poinnya adalah, tidak masalah apa yang
2004
+ kalian semua pilih, cukup tetaplah konsisten.
2003
2005
2004
2006
** Buruk:**
2005
2007
``` javascript
@@ -2034,9 +2036,10 @@ class Alpaca {}
2034
2036
2035
2037
2036
2038
### Fungsi yg memanggil dan yang dipanggil seharusnya berdekatan
2037
- If a function calls another, keep those functions vertically close in the source
2038
- file. Ideally, keep the caller right above the callee. We tend to read code from
2039
- top-to-bottom, like a newspaper. Because of this, make your code read that way.
2039
+ Jika sebuah fungsi memanggil yang lainnya, jagalah fungsi tersebut secara vertikal
2040
+ berdekatan dengan sumber. Secara ideal, jaga yang memanggil tepat dibawah yang
2041
+ dipanggil. Kita cenderung membaca kode dari atas-ke-bawah, seperti koran. Karenanya,
2042
+ buat kodemu terbaca seperti itu.
2040
2043
2041
2044
** Buruk:**
2042
2045
``` javascript
@@ -2120,24 +2123,25 @@ review.perfReview();
2120
2123
2121
2124
## ** Komentar**
2122
2125
### Komentar hanya untuk hal-hal yang memiliki kompleksitas logika.
2123
- Comments are an apology, not a requirement. Good code * mostly* documents itself.
2126
+ Komentar adalah sebuah permintaan maaf, bukan sebuah syarat. Kode yang baik
2127
+ * kebanyakan* bisa mendokumentasikan dirinya sendiri.
2124
2128
2125
2129
** Buruk:**
2126
2130
``` javascript
2127
2131
function hashIt (data ) {
2128
- // The hash
2132
+ // ini hash
2129
2133
let hash = 0 ;
2130
2134
2131
- // Length of string
2135
+ // panjang dari sebuah string
2132
2136
const length = data .length ;
2133
2137
2134
- // Loop through every character in data
2138
+ // Loop setiap karakter dalam sebuah data
2135
2139
for (let i = 0 ; i < length; i++ ) {
2136
- // Get character code.
2140
+ // mendapatkan karakter di kode
2137
2141
const char = data .charCodeAt (i);
2138
- // Make the hash
2142
+ // Membuah hash
2139
2143
hash = ((hash << 5 ) - hash) + char;
2140
- // Convert to 32-bit integer
2144
+ // mengonversi ke 32-bit integer
2141
2145
hash &= hash;
2142
2146
}
2143
2147
}
@@ -2154,7 +2158,7 @@ function hashIt(data) {
2154
2158
const char = data .charCodeAt (i);
2155
2159
hash = ((hash << 5 ) - hash) + char;
2156
2160
2157
- // Convert to 32-bit integer
2161
+ // Mengonversi ke 32-bit integer
2158
2162
hash &= hash;
2159
2163
}
2160
2164
}
@@ -2163,7 +2167,7 @@ function hashIt(data) {
2163
2167
** [ ⬆ Kembali ke atas] ( #daftar-isi ) **
2164
2168
2165
2169
### Jangan meninggalkan kode yang dikomentari dalam basis kode anda
2166
- Version control exists for a reason. Leave old code in your history .
2170
+ ` Version control ` ada karena sebuah alasan. Tinggalkan kode lamamu di riwayat .
2167
2171
2168
2172
** Buruk:**
2169
2173
``` javascript
@@ -2180,8 +2184,9 @@ doStuff();
2180
2184
** [ ⬆ Kembali ke atas] ( #daftar-isi ) **
2181
2185
2182
2186
### Jangan ada komentar tentang jurnal
2183
- Remember, use version control! There's no need for dead code, commented code,
2184
- and especially journal comments. Use ` git log ` to get history!
2187
+ Ingat, gunakan version control! Tidak perlu kode mati, kode yang dikomentari,
2188
+ dan khususnya komentar tentang jurnal. Gunakan ` git log ` untuk mendapatkan
2189
+ riwayat!
2185
2190
2186
2191
** Buruk:**
2187
2192
``` javascript
@@ -2205,8 +2210,9 @@ function combine(a, b) {
2205
2210
** [ ⬆ Kembali ke atas] ( #daftar-isi ) **
2206
2211
2207
2212
### Hindari komentar marker
2208
- They usually just add noise. Let the functions and variable names along with the
2209
- proper indentation and formatting give the visual structure to your code.
2213
+ Mereka biasanya hanya menambahkan kebisingan. Biarkan nama fungsi dan variabel
2214
+ bersama dengan indentasi yang layak dan susunan format memberikan struktur visual
2215
+ ke kode-mu.
2210
2216
2211
2217
** Buruk:**
2212
2218
``` javascript
0 commit comments