You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/13-modules/02-import-export/article.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,43 +190,43 @@ import *!*User*/!* from './user.js'; // {User} değir, sadece User
190
190
new User('John');
191
191
```
192
192
193
-
Imports without curly braces look nicer. A common mistake when starting to use modules is to forget curly braces at all. So, remember, `import` needs curly braces for named imports and doesn't need them for the default one.
193
+
Süslü parantezler olmadan içeri aktarmalar daha güzel görünür. Modülleri kullanmaya başlarken görülen yaygın hatalardan biri süslü parantezleri tamamen unutmaktır. Bu nedenle, unutmayın. `import` adlandırılmış içeriye aktarma işlemleri için süslü parantezler gereklidir ama varsayılan için bunlara gerek yoktur.
| `export class User {...}` | `export default class User {...}` |
198
198
| `import {User} from ...` | `import User from ...`|
199
199
200
-
Naturally, there may be only one "default"exportperfile.
200
+
Doğal olarak, dosya başına yalnızca bir "varsayılan" dışa aktarma olabilir.
201
201
202
-
We may have both default and named exportsin a single module, but in practice people usually don't mix them. A module has either named exports or the default one.
202
+
Tek bir modülde hem varsayılan hem de adlandırılmış içeriye aktarma yapabiliriz ancak pratikte insanlar genellikle bunu karıştırmaz. Bir modül, dışa aktarma adını verir veya varsayılan olanıdır.
203
203
204
-
**Another thing to note is that named exports must (naturally) have a name, while `export default` may be anonymous.**
204
+
**Unutulmaması gereken bir başka şey de, dışa aktarma adının (doğal olarak) bir adı olması gerekirken, `export default` adsız olabilir**
205
205
206
-
For instance, these are all perfectly valid default exports:
206
+
Örneğin, Bunların hepsi mükemmel ve doğru `default export` kullanımları:
207
207
208
208
```js
209
-
export default class { // no class name
209
+
export default class { // sınıf adı yok
210
210
constructor() { ... }
211
211
}
212
212
213
-
export default function(user) { // no function name
213
+
export default function(user) { // fonksiyon adı yok
214
214
alert(`Hello, ${user}!`);
215
215
}
216
216
217
-
// export a single value, without making a variable
217
+
// bir değişken yapmadan tek bir değer dışarıya aktar
That's fine, because`export default`is only one per file. Contrary to that, omitting a name for named imports would be an error:
221
+
Bu iyi çünkü `export default` dosya başına yalnızca bir tanesidir. Bunun aksine, adlandırılmış içeriye aktarma için bir adın çıkarılması bir hata olur:
222
222
223
223
```js
224
-
export class { // Error! (non-default export needs a name)
224
+
export class { // Hata! (non-default export needs a name)
225
225
constructor() {}
226
226
}
227
227
```
228
228
229
-
### "Default"alias
229
+
### "Default" Takma Adı
230
230
231
231
The "default" keyword is used as an "alias" for the default export, for standalone exports and other scenarios when we need to reference it.
0 commit comments