Skip to content

Commit 38e6bf3

Browse files
authored
Merge pull request #252 from Furkan-Gulsen/patch-11
Translation of English parts into Turkish
2 parents 57eecbb + 780ca34 commit 38e6bf3

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
@@ -162,33 +162,34 @@ Bazen, `this`'in değeri tamamen evrensel obje olur. Bu çok nadir de olsa bazı
162162

163163
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.
164164

165-
## Using for polyfills
165+
## Polyfill'ler İçin Kullanma
166166
167-
We use the global object to test for support of modern language features.
167+
Modern dil özelliklerinin desteğini test etmek için global nesneyi kullanıyoruz.
168168
169-
For instance, test if a built-in `Promise` object exists (it doesn't in really old browsers):
169+
Örneğin, yerleşik bir "Promise" nesnesinin olup olmadığını test edelim (gerçekten eski tarayıcılarda yoktur):
170170
```js run
171171
if (!window.Promise) {
172-
alert("Your browser is really old!");
172+
alert("Senin tarayıcın gerçekten çok yaşlı");
173173
}
174174
```
175175
176-
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.
176+
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.
177177
178178
```js run
179179
if (!window.Promise) {
180-
window.Promise = ... // custom implementation of the modern language feature
180+
window.Promise = ... // modern dil özelliğinin özel uygulaması
181181
}
182182
```
183183
184-
## Summary
184+
## Özet
185185
186-
- The global object holds variables that should be available everywhere.
186+
- Global nesne, her yerde bulunması gereken değişkenleri tutar.
187187
188-
That includes JavaScript built-ins, such as `Array` and environment-specific values, such as `window.innerHeight` -- the window height in the browser.
189-
- The global object has a universal name `globalThis`.
188+
Buna "Array" gibi JavaScript yerleşikleri ve "window.innerHeight" gibi ortama özgü değerler - tarayıcıdaki pencere yüksekliği dahildir.
189+
- Global nesnenin evrensel bir adı 'globalThis' vardır.
190190
191-
...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).
192-
- We should store values in the global object only if they're truly global for our project. And keep their number at minimum.
193-
- In-browser, unless we're using [modules](info:modules), global functions and variables declared with `var` become a property of the global object.
194-
- To make our code future-proof and easier to understand, we should access properties of the global object directly, as `window.x`.
191+
...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).
192+
193+
- Değerleri yalnızca projemiz için gerçekten küresellerse global nesnede saklamalıyız. Ve sayılarını minimumda tutun.
194+
- 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.
195+
- 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)