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/01-getting-started/1-intro/article.md
+88Lines changed: 88 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,32 @@
1
1
# JavaScript'e Giriş
2
2
3
+
<<<<<<< HEAD
3
4
Bakalım JavaScript nedir, ne yapılır ve hangi teknolojilerle birlikte çalışır.
5
+
=======
6
+
Let's see what's so special about JavaScript, what we can achieve with it, and what other technologies play well with it.
7
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
4
8
5
9
## JavaScript Nedir?
6
10
11
+
<<<<<<< HEAD
7
12
*JavaScript*, ilk başta *"web belgelerine canlılık"* getirmek için oluşturulmuştur.
13
+
=======
14
+
*JavaScript* was initially created to "make web pages alive".
15
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
8
16
9
17
Bu dilde yazılan kod kümelerine betik denir. Doğrudan HTML kodu içerisine yazılıp sayfa yüklendiğinde doğrudan çalışabilir.
10
18
11
19
Komutlar herhangi bir derleme ve hazırlığa gereksinim duymadan doğrudan çalışırlar.
12
20
13
21
Bu yönden bakınca JavaScript diğer dillere kıyasla oldukça farklıdır. Bkz: [Java](https://en.wikipedia.org/wiki/Java_(programming_language)).
14
22
23
+
<<<<<<< HEAD
15
24
```smart header="Neden <u>Java</u>Script?"
16
25
JavaScript ilk yazıldığında, başka bir adı vardı: "LiveScript". Ancak Java dili o dönemlerde çok ünlü olduğundan dolayı yeni bir dil ve "küçük kardeş" gibi görünmesi açısından JavaScript olarak değiştirildi.
26
+
=======
27
+
```smart header="Why is it called <u>Java</u>Script?"
28
+
When JavaScript was created, it initially had another name: "LiveScript". But Java was very popular at that time, so it was decided that positioning a new language as a "younger brother" of Java would help.
29
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
17
30
18
31
Ancak JavaScript gelişerek kendince yönergeleri [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript) olan bağımsız bir dil haline geldi. Şu anda Java ile hiçbir ilgisi bulunmamaktadır.
19
32
```
@@ -25,26 +38,46 @@ Tarayıcılar bu JavaScript motoru gömülü bir biçimde gelirler. Bu ayrıca "
25
38
26
39
Bu JavaScript motorlarından bazıları şunlardır;
27
40
41
+
<<<<<<< HEAD
28
42
-[V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- Chrome ve Opera.
- Internet Explorer'ın "Trident", "Chakra" takma adlı motorlarının yanında Microsoft Edge için "ChakraCore" adında ayrı bir motoru bulunmaktadır. Safari ise "Nitro", "SquirrelFish" ve "SquirrelFish Extreme" gibi takma adlarla adlandırılan JavaScript motorunu kullanmaktadır.
31
45
32
46
Yukarıdaki terimleri aklınızda tutarsanız iyi olur, çünkü ileride şu tür tümcelerle karşılaşabilirsiniz: "V8'de A özelliğinin altyapısı", "Bu özelliğin altyapısının Chrome ve Opera'da bulunduğunu anlamanız gerekir."
47
+
=======
48
+
-[V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge.
49
+
-[SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
50
+
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc.
51
+
52
+
The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome, Opera and Edge.
53
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
33
54
34
55
```smart header="JavaScript Motoru Nasıl Çalışır?"
35
56
36
57
Motorlar çok karmaşık yapılardır. Ancak kolay ögelere dayanırlar.
37
58
59
+
<<<<<<< HEAD
38
60
1. Eğer bu motor tarayıcıya gömülmüş ise yazılan JavaScript kodlarını ayrıştırır.
39
61
2. Sonra bu kodları makine diline çevirir.
40
62
3. Makine bu kodları çok hızlı bir biçimde çalıştırır.
41
63
42
64
Motor bu sürecin her bir adımında iyileştirme yapar. Hatta derlenmiş ve çalışır durumda bulunan kodlardaki veri yapılarını inceler ve bunları iyileştirerek daha hızlı duruma getirir. Sonuç olarak yazılan bu kodlar çok hızlı bir biçimde çalışır.
65
+
=======
66
+
1. The engine (embedded if it's a browser) reads ("parses") the script.
67
+
2. Then it converts ("compiles") the script to machine code.
68
+
3. And then the machine code runs, pretty fast.
69
+
70
+
The engine applies optimizations at each step of the process. It even watches the compiled script as it runs, analyzes the data that flows through it, and further optimizes the machine code based on that knowledge.
Günümüz JavaScript'i "güvenli" bir programlama dilidir. Düşük düzeydeki diller gibi bellek veya işlemciye doğrudan erişim sağlamaz. Tarayıcı için olduğundan dolayı böyle bir şeye gereksinim duymaz.
78
+
=======
79
+
Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or the CPU, because it was initially created for browsers which do not require it.
80
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
48
81
49
82
JavaScript'in yapabilecekleri büyük bir oranda ortama dayanır. Örneğin [Node.JS](https://wikipedia.org/wiki/Node.js), JavaScript işlevleri ile dosyaları okuma, yazma veya ağ üzerinden isteme işlemlerini yapabilir.
50
83
@@ -60,14 +93,23 @@ Tarayıcı içerisindeki JavaScript ise web sayfasında görsel değişikliklere
60
93
61
94
## Tarayıcı içerisinde bulunan JavaScript ne yapamaz?
62
95
96
+
<<<<<<< HEAD
63
97
Tarayıcı içerisinde bulunan JavaScript kullanıcı güvenliği amacıyla sınırlandırılmıştır. Amaç zararlı web sitelerinin özel bilgilere erişip kullanıcıya zarar vermesini engellemektir.
98
+
=======
99
+
JavaScript's abilities in the browser are limited to protect the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
100
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
64
101
65
102
Bu engellemeleri şu biçimde sıralayabiliriz :
66
103
104
+
<<<<<<< HEAD
67
105
- Web sayfasında çalışan JavaScript dosyalara erişim sağlayamaz, saklama alanınızda bulunan programları kopyalayamaz veya çalıştıramaz. İşletim sisteminizin fonksiyonlarına doğrudan erişimi yoktur.
106
+
=======
107
+
- JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS functions.
108
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
68
109
69
110
Günümüz tarayıcıları dosyalarla çalışmanıza izin verebilir. Ancak bu izin oldukça sınırlıdır. Örneğin, yalnızca dosyayı tarayıcıya taşıyıp bırakabilirsiniz veya `<input>` kullanarak dosyayı seçebilirsiniz.
70
111
112
+
<<<<<<< HEAD
71
113
Her zaman kullanıcıyla kamera veya mikrofon vasıtasıyla veya diğer aygıtlar aracılığıyla etkileşime geçebilirsiniz. Ancak kullanıcının kesin iznini almanız gerekir. Dolayısıyla bir web sayfası JavaScript ile gizliden sizin web kameranızı izleyemez veya çevrenizde bulunanlar hakkında bilgi alamaz. [NSA](https://en.wikipedia.org/wiki/National_Security_Agency)
72
114
73
115
- Farklı sekmeler birbiri ile iletişime geçemez ve bilgi alışverişi yapamazlar. Bazı sitelerde aynı sekmeler iletişimde bulunabilir, örneğin bir sekmeden JavaScript ile diğer sekmeyi açabilirsiniz. Bu durumda bile, bir sayfa diğerinden farklı alan adı, kural veya kapılarda ise erişemez.
@@ -78,43 +120,89 @@ Bu engellemeleri şu biçimde sıralayabiliriz :
78
120

79
121
80
122
Bu sınırlar, tarayıcı dışında kullanıldığında ortadan kalkar. Örneğin, sunucular daha geniş yetkilere sahiptir.
123
+
=======
124
+
There are ways to interact with the camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
125
+
- Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other page if they come from different sites (from a different domain, protocol or port).
126
+
127
+
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and must contain special JavaScript code that handles it. We'll cover that in the tutorial.
128
+
129
+
This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com`, for example, and steal information from there.
130
+
- JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is severely limited. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
131
+
132
+

133
+
134
+
Such limitations do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugins/extensions which may ask for extended permissions.
135
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
81
136
82
137
## JavaScript'i eşsiz yapan nedir ?
83
138
84
139
JavaScript'i eşsiz yapan en az 3 neden vardır:
85
140
86
141
```compare
142
+
<<<<<<< HEAD
87
143
+ HTML/CSS ile tamamen bütünleşik çalışması.
88
144
+ Basit şeyler basitçe yapılır.
89
145
+ Tüm önemli tarayıcılarda çalışır ve ön tanımlı olarak etkindir.
146
+
=======
147
+
+ Full integration with HTML/CSS.
148
+
+ Simple things are done simply.
149
+
+ Supported by all major browsers and enabled by default.
150
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
90
151
```
91
152
92
153
JavaScript'ten başka bu üç özelliği taşıyan hiçbir tarayıcı teknolojisi yoktur.
93
154
155
+
<<<<<<< HEAD
94
156
JavaScript'in eşsiz olma nedeni budur ve bu yüzden web sayfaları geliştirmekte kullanılan en yaygın araçtır.
95
157
96
158
Yeni bir teknolojiyi öğrenmeye başlarken, sunacağı avantajlar için öngörü önemlidir. Bu sebeptendir ki, yeni diller ve tarayıcı yetkinlikleri içeren bu yönelimlere ayak uydurmalıyız.
159
+
=======
160
+
That said, JavaScript can be used to create servers, mobile applications, etc.
161
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
97
162
98
163
## JavaScript'e üstün diller
99
164
100
165
JavaScript'in söz dizimi ve yazımı herkese uymayabilir. Her yiğidin yoğurt yiyişi farklıdır.
101
166
102
167
Bu olağan bir durum, çünkü tasarımlar ve gereksinimler kişiden kişiye göre değişir.
103
168
169
+
<<<<<<< HEAD
104
170
Bundan dolayı yakın zamanda bir sürü yeni *transpiled* yani çevirilmiş diller türemiştir. Bu diller, çalıştırılmadan önce JavaScript'e çevriliyor. Günümüz araçları bu çeviri işini çok hızlı bir biçimde yapmaktadır. Gerçekte, doğrudan —siz yazarken bile— çevirme işini yapıp bu yeni dosyayı kullanılabilir duruma getirirler.
171
+
=======
172
+
So, recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
173
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
105
174
106
175
Bu dillere örnek vermek gerekirse:
107
176
177
+
<<<<<<< HEAD
108
178
-[CofeeScript](http://coffeescript.org) JavaScript için "şeker yazım" denebilecek bir dildir. Yazılımı daha kısadır ve daha temiz kod yazmaya yardımcı olur. Genellikle [Ruby](https://www.ruby-lang.org/tr/) geliştiriciler bunu sever.
109
179
110
180
-[Typescript](http://www.typescriptlang.org/) durağan veri yapıları ile JavaScript yazılmasını sağlar. Karmaşık programlar geliştirmeyi kolaylaştırır. Microsoft tarafından geliştirilmiştir.
111
181
112
182
-[Dart](https://www.dartlang.org/) kendi başına ayrı bir dildir. Tarayıcı üzerinde veya telefon uygulamalarında kendi motoru üzerinden çalıştırılır. Google'ın tarayıcılarda JavaScript yerine Dart'ı önermiş olmasına karşın, bugünlerde JavaScript'e çeviri yapılarak kullanılmaktadır.
183
+
=======
184
+
Examples of such languages:
185
+
186
+
-[CoffeeScript](https://coffeescript.org/) is "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
187
+
-[TypeScript](https://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
188
+
-[Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
189
+
-[Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps), but also can be transpiled to JavaScript. Developed by Google.
190
+
-[Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
191
+
-[Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
192
+
193
+
There are more. Of course, even if we use one of these transpiled languages, we should also know JavaScript to really understand what we're doing.
194
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
113
195
114
196
Bunlara daha fazla örnek eklenebilir. Yukarıdakileri bilseniz bile ne yaptığınızı tam olarak anlamak için JavaScript bilmelisiniz.
115
197
198
+
<<<<<<< HEAD
116
199
## Özet
117
200
118
201
- JavaScript başlangıçta yalnızca ağ tarayıcılarında kullanılmak üzere geliştirilmiş bir dildi. Ancak günümüzde, birçok çevrede çalışabilir durumda.
119
202
- JavaScript şu anda HTML/CSS ile bütünleşik olmasından ve geniş uyumluluğundan dolayı benzersizdir.
120
203
- Birçok JavaScript'e çevirici dil bulunmaktadır. JavaScript'i iyi bir biçimde öğrendikten sonra bu dillere de bir bakmanızı öneririz.
204
+
=======
205
+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
206
+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
207
+
- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/2-manuals-specifications/article.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,17 @@
1
1
2
2
# Kılavuz ve Şartnameler
3
3
4
+
<<<<<<< HEAD
4
5
Bu kitap aslında bir *eğitim süreci*'dir. Amacı sizin kademeli olarak JavaScript öğrenmenizi sağlamaktır. Önce temellere alıştıktan sonra diğer kaynaklar üzerinde durulacaktır.
5
6
6
7
## Şartname
8
+
=======
9
+
This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other resources.
10
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
7
11
8
12
**ECMA-262 Şartnamesi** JavaScript için olabilecek en derin bilgilerin bulunduğu kaynaktır. Dili tanımlar.
9
13
14
+
<<<<<<< HEAD
10
15
Fakat resmi bir dil kullanıldığından dolayı ilk seferde anlaması zordur. Eğer en güvenilir kaynak neredir diye soracak olursanız bunun cevabı **ECMA-262 Şartnamesi**'dir. Fakat her an gidip kolayca bilgi alabileceğiniz bir kaynak değildir.
11
16
12
17
Son taslağına <https://tc39.es/ecma262/> adresinden erişebilirsiniz.
@@ -16,9 +21,21 @@ Daha geniş kitleler tarafından kullanılmayan yeni özelliklere ve önerilere
16
21
Ayrıca, tarayıcı için geliştirme yapıyorsanız, [ikinci bölümden](info:browser-environment) farklı eğitimlere bakabilirsiniz.
17
22
18
23
## Kılavuz
24
+
=======
25
+
[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.
26
+
27
+
But being that formalized, it's difficult to understand at first. So if you need the most trustworthy source of information about the language details, the specification is the right place. But it's not for everyday use.
28
+
29
+
A new specification version is released every year. Between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
30
+
31
+
To read about new bleeding-edge features, including those that are "almost standard" (so-called "stage 3"), see proposals at <https://github.com/tc39/proposals>.
32
+
33
+
Also, if you're developing for the browser, then there are other specifications covered in the [second part](info:browser-environment) of the tutorial.
34
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
19
35
20
36
-**MDN (Mozilla) JavaScript Reference** örnek ve kılavuzların yeraldığı bir diğer kaynaktır. İstediğiniz konular derinlemesine incelemek için harika bir kaynaktır.
21
37
38
+
<<<<<<< HEAD
22
39
Buradan erişebilirsiniz: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>
23
40
24
41
Google'da "MDN [term]" şeklinde aratırsanız aslında çok daha kolay erişebilirsiniz. Örneğin : `parseInt`'i aramak için <https://google.com/search?q=MDN+parseInt> kullanabilirsiniz.
@@ -32,11 +49,29 @@ Ayrıca, tarayıcı için geliştirme yapıyorsanız, [ikinci bölümden](info:b
32
49
JavaScript çok hızlı gelişen bir dildir, sürekli olarak yeni özellikler eklenir.
33
50
34
51
Bunların tarayıcılarda desteklenip desteklenmediğini görmek için:
52
+
=======
53
+
-**MDN (Mozilla) JavaScript Reference** is the main manual with examples and other information. It's great to get in-depth information about individual language functions, methods etc.
54
+
55
+
You can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
56
+
57
+
Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for the `parseInt` function.
58
+
59
+
## Compatibility tables
60
+
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf
35
61
36
62
-<http://caniuse.com> - özellik bazlı tablo mevcuttur. Örneğin hangi JavaScript motorları cryptography özelliğini destekliyor sorusunun cevabını <http://caniuse.com/#feat=cryptography> adresinden bulabilirsiniz.
37
63
38
64
-<https://kangax.github.io/compat-table> - dil özelliğinin motorların hangisinde desteklenip hangisinde desteklenmediğini gösterir.
39
65
66
+
<<<<<<< HEAD
40
67
Bunların hepsi günlük hayatta işinize yarayacak kaynaklardır. Dil detayları ve bunların destekleri ile alakalı detaylar bulunmaktadır.
41
68
42
69
Lütfen belirli bir özelliği daha derinlemesine incelemek isterseniz bunları veya bu sayfayı hatırlayın.
70
+
=======
71
+
-<https://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <https://caniuse.com/#feat=cryptography>.
72
+
-<https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
73
+
74
+
All these resources are useful in real-life development, as they contain valuable information about language details, their support, etc.
75
+
76
+
Please remember them (or this page) for the cases when you need in-depth information about a particular feature.
0 commit comments