Skip to content

Commit 780ca34

Browse files
Translation of English parts into Turkish
1 parent 3f32d6b commit 780ca34

File tree

1 file changed

+15
-14
lines changed
  • 1-js/06-advanced-functions/05-global-object

1 file changed

+15
-14
lines changed

1-js/06-advanced-functions/05-global-object/article.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,33 +164,34 @@ Bazen, `this`'in değeri tamamen evrensel obje olur. Bu çok nadir de olsa bazı
164164
165165
Tanım gereği, `this` bu durumda evrensel obje olmalı, Node.JS ortamında olmasa bile `this` evrensel objedir. Bu eski kodlar ile uyumluluk amacıyladır, sıkı modda `this` tanımsız olabilir.
166166
167-
## Using for polyfills
167+
## Polyfill'ler İçin Kullanma
168168
169-
We use the global object to test for support of modern language features.
169+
Modern dil özelliklerinin desteğini test etmek için global nesneyi kullanıyoruz.
170170
171-
For instance, test if a built-in `Promise` object exists (it doesn't in really old browsers):
171+
Örneğin, yerleşik bir "Promise" nesnesinin olup olmadığını test edelim (gerçekten eski tarayıcılarda yoktur):
172172
```js run
173173
if (!window.Promise) {
174-
alert("Your browser is really old!");
174+
alert("Senin tarayıcın gerçekten çok yaşlı");
175175
}
176176
```
177177
178-
If there's none (say, we're in an old browser), we can create "polyfills": add functions that are not supported by the environment, but exist in the modern standard.
178+
Hiçbiri yoksa (örneğin, eski bir tarayıcıdayız), "pollyfills(çoklu dolgular)" oluşturabiliriz: çevre tarafından desteklenmeyen, ancak modern standartta var olan işlevler ekleyebiliriz.
179179
180180
```js run
181181
if (!window.Promise) {
182-
window.Promise = ... // custom implementation of the modern language feature
182+
window.Promise = ... // modern dil özelliğinin özel uygulaması
183183
}
184184
```
185185
186-
## Summary
186+
## Özet
187187
188-
- The global object holds variables that should be available everywhere.
188+
- Global nesne, her yerde bulunması gereken değişkenleri tutar.
189189
190-
That includes JavaScript built-ins, such as `Array` and environment-specific values, such as `window.innerHeight` -- the window height in the browser.
191-
- The global object has a universal name `globalThis`.
190+
Buna "Array" gibi JavaScript yerleşikleri ve "window.innerHeight" gibi ortama özgü değerler - tarayıcıdaki pencere yüksekliği dahildir.
191+
- Global nesnenin evrensel bir adı 'globalThis' vardır.
192192
193-
...But more often is referred by "old-school" environment-specific names, such as `window` (browser) and `global` (Node.js). As `globalThis` is a recent proposal, it's not supported in non-Chromium Edge (but can be polyfilled).
194-
- We should store values in the global object only if they're truly global for our project. And keep their number at minimum.
195-
- In-browser, unless we're using [modules](info:modules), global functions and variables declared with `var` become a property of the global object.
196-
- To make our code future-proof and easier to understand, we should access properties of the global object directly, as `window.x`.
193+
...Ancak daha sık olarak "window(tarayıcı)" ve "global(Node.js)" gibi "eski tarz" çevreye özgü adlarla anılır. "globalThis" yeni bir teklif olduğundan, Chromium Edge dışında desteklenmemektedir (ancak polyfilled olabilir).
194+
195+
- Değerleri yalnızca projemiz için gerçekten küresellerse global nesnede saklamalıyız. Ve sayılarını minimumda tutun.
196+
- Tarayıcıda, [modules](info:modules) kullanmadığımız sürece, 'var' ile bildirilen global işlevler ve değişkenler global nesnenin bir özelliği haline gelir.
197+
- Kodumuzu geleceğe dönük ve daha kolay anlaşılır kılmak için global nesnenin özelliklerine doğrudan "window.x" olarak erişmeliyiz.

0 commit comments

Comments
 (0)