Skip to content

Commit 364d906

Browse files
Merge pull request #101 from javascript-tutorial/sync-fb4fc33a
Sync with upstream @ fb4fc33
2 parents 1777461 + b83b64d commit 364d906

File tree

758 files changed

+25726
-6920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

758 files changed

+25726
-6920
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* text=auto eol=lf
2+
*.svg binary

1-js/01-getting-started/1-intro/article.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
11
# JavaScript-ga kirish
22

3+
<<<<<<< HEAD
34
Keling, JavaScript-da nima muhimligini, u bilan nimaga erisha olishimizni va qanday boshqa texnologiyalar bilan ushbu til yaxshi qo'llanilishini ko'rib chiqaylik.
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+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
48
59
## JavaScript bu nima?
610

11+
<<<<<<< HEAD
712
*JavaScript* dastlab *"veb-sahifalarni jonlantirish"* uchun yaratilgan edi.
813

914
Ushbu tilda dasturlar *skript* deb nomlanadi. Ular veb-sahifani HTML-da yozilishi mumkin va sahifa brauzer tomonidan yuklanganidan keyin ular avtomatik ravishda amalga oshiriladi.
15+
=======
16+
*JavaScript* was initially created to "make web pages alive".
17+
18+
The programs in this language are called *scripts*. They can be written right in a web page's HTML and run automatically as the page loads.
19+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
1020
1121
Skriptlar oddiy matn sifatida taqdim etiladi va amalga oshiriladi. Ularni ishga tushirish uchun maxsus tayyorgarlik yoki kompilatsiya kerak emas.
1222

1323
Shu jihatdan, JavaScript [Java] (https://en.wikipedia.org/wiki/Java_(programming_language)) tilidan juda farq qiladi.
1424

25+
<<<<<<< HEAD
1526
```smart header="Nega <u>Java</u>Script?"
1627
JavaScript yaratilganda, u dastlab "LiveScript" nomi bilan taqdim etilgan edi. Ammo Java o'sha paytlarda juda mashhur edi, shuning uchun Java tilining "ukasi" sifatida yangi tilni taqdim etish g'oyasi JS mashhur bo'lishga yordam beradi deb hisoblangan .
28+
=======
29+
```smart header="Why is it called <u>Java</u>Script?"
30+
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.
31+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
1732
1833
Ammo, rivojlanish jarayonida, JavaScript [ECMAScript] (http://en.wikipedia.org/wiki/ECMAScript) deb ataladigan o'z xususiyatiga ega to'liq mustaqil tilga aylangan va hozirda Java tiliga hech qanday aloqasi yo'q.
1934
```
@@ -24,9 +39,15 @@ Brauzerlar o'z JavaScript interpretatorlariga ega, ular gohida "JavaScript virtu
2439

2540
Har bir intetptretatorni o'z nomi mavjud. Masalan:
2641

42+
<<<<<<< HEAD
2743
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- Chrome va Opera brauzerlarida qo'llanadi.
2844
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- Firefox brauzerida.
2945
- ...net Explorer brauerning turli xil versiyalari uchun "Trident" va "Chakra", Microsoft Edge uchun "ChakraCore", Safari uchun "Nitro" va "SquirrelFish" va boshqalar kabi boshqa kod nomlari mavjud.
46+
=======
47+
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
48+
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
49+
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc.
50+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
3051
3152
Yuqoridagi atamalarni eslab qolish yaxshi, chunki ular netdagi ishlab chiquvchilar maqolalarida qo'llaniladi. Biz ulardan ham foydalanamiz. Masalan, agar "X funktsiyasini V8 qo'llab-quvvatlasa", ehtimol u Chrome va Opera-da ishlaydi.
3253

@@ -39,7 +60,11 @@ Intetptretatorlar murakkab. Ammo asoslari oson.
3960
3. And then the machine code runs, pretty fast.
4061
1. intetptretator (agar u brauzer bo'lsa, avtomatik o'rnatilgan) skriptni o'qiydi ("tahlil qiladi").
4162
63+
<<<<<<< HEAD
4264
Interpretatatsiya jarayonning har bir bosqichida optimallashtirishlarni qo'llaydi. U hattoki kompilyatsiya qilingan skriptni ishlayotganda kuzatib boradi, u orqali oqib o'tadigan ma'lumotlarni tahlil qiladi va shu bilimga asoslangan holda mashina kodiga optimallashtirishlarni qo'llaydi. Tugatgandan so'ng, skriptlar juda tez ishlaydi.
65+
=======
66+
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.
67+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
4368
```
4469

4570
## Brauzerdagi JavaScript nimani bajara oladi?
@@ -64,14 +89,22 @@ JavaScript-ning brauzerdagi imkoniyatlari foydalanuvchi xavfsizligi uchun chekla
6489

6590
Bunday cheklovlarga quyidagilar kiradi:
6691

92+
<<<<<<< HEAD
6793
- Veb-sahifadagi JavaScript-ni qattiq diskdagi o'zboshimchalik bilan fayllarni o'qish / yozish, ularni nusxalash yoki dasturlarni bajarish mumkin emas. Uning OS tizimi funktsiyalariga to'g'ridan-to'g'ri kirish imkoniyati yo'q.
94+
=======
95+
- 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.
96+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
6897
6998
Zamonaviy brauzerlar unga fayllar bilan ishlashga imkon beradi, lekin kirish cheklangan va faqat foydalanuvchi brauzer oynasiga faylni "tushirish" yoki uni `<input>` yorlig'i orqali tanlash kabi ba'zi bir amallarni bajargan taqdirdagina taqdim etiladi.
7099

71100
Kamera / mikrofon va boshqa qurilmalar bilan o'zaro aloqa qilish usullari mavjud, ammo ular foydalanuvchidan aniq ruxsat talab qiladi. Shunday qilib, JavaScript-ni qo'llab-quvvatlaydigan sahifa veb-kamerani yashirincha yoqmasligi, atrofni kuzatishi va ma'lumotni[NSA](https://en.wikipedia.org/wiki/National_Security_Agency) ga yuborishi mumkin emas.
72101
- Turli xil yorliqlar / oynalar odatda bir-birlarini bilishmaydi. Ba'zan ular bilishadi, masalan, bitta oyna ikkinchisini ochish uchun JavaScript-ni ishlatganda. Ammo bu holatda ham bitta sahifadagi JavaScript-ni boshqa saytlarga kirish mumkin emas, agar ular turli saytlardan (boshqa domendan, protokoldan yoki portdan) bo'lsa.
73102

103+
<<<<<<< HEAD
74104
Bu "Xuddi shu manba siyosati"(Same origin policy) deyiladi. Buning uchun *ikkala sahifa* ma'lumotlar almashinuvi to'g'risida kelishib olishlari va uni boshqaradigan maxsus JavaScript kodini o'z ichiga olishi kerak. Biz buni o'quv qo'llanmasida ko'rib chiqamiz.
105+
=======
106+
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and contain a special JavaScript code that handles it. We'll cover that in the tutorial.
107+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
75108
76109
Ushbu cheklov, yana foydalanuvchi xavfsizligi uchun. Foydalanuvchi ochgan sahifa `http://anysite.com` URL manzili bo'lgan boshqa brauzer yorlig'iga kira olmasligi kerak `http://gmail.com` va u erdan ma'lumotlarni o'g'irlash.
77110

@@ -94,9 +127,13 @@ JavaScript - bu uchta narsani birlashtirgan yagona brauzer texnologiyasidir.
94127

95128
Bu JavaScript-ni noyob qiladi. Shuning uchun u brauzer feyslarini yaratishda eng keng tarqalgan vositadir.
96129

130+
<<<<<<< HEAD
97131
Yangi texnologiyani o'rganishni rejalashtirayotib, uning istiqbollarini tekshirish ham muhimdir. Keling, zamonaviy tendentsiyalarga o'taylik.
98132

99133
## JavaScript "ustidan" qo'llanadigan tillar
134+
=======
135+
That said, JavaScript also allows to create servers, mobile applications, etc.
136+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
100137
101138
JavaScript-ning sintaksisi hammaning ehtiyojlariga mos kelmaydi. Turli odamlar turli xususiyatlarni xohlashadi.
102139

@@ -112,10 +149,27 @@ Bunday tillarning namunalari:
112149
- [TypeScript] (http://www.typescriptlang.org/) murakkab tizimlarni ishlab chiqish, soddalashtirish va qo'llab-quvvatlash uchun "strict data typing"ni qo'shishga qaratilgan. Microsoft tomonidan ishlab chiqilgan.
113150
- [Dart] (https://www.dartlang.org/) brauzer bo'lmagan muhitda (mobil ilovalar kabi) ishlaydigan o'z dvigateliga ega bo'lgan mustaqil til. Bu dastlab JavaScript uchun zaxira sifatida Google tomonidan taklif etildi, lekin hozirgi paytda, brauzerlar shu tilni ham JS-ga transpilatsiya bo'lishini talab qilishadi.
114151

152+
<<<<<<< HEAD
115153
Bundan ham ko'proq tillar mavjud. Albatta, biz bu tillardan birini ishlatsak ham, biz nima qilayotganimizni tushunish uchun JavaScript-ni bilishimiz kerak.
116154

117155
## Xulosa
118156

119157
- JavaScript dastlab brauzer tili sifatida yaratilgan, ammo hozirgi paytda ko'pgina boshqa muhitlarda ham qo'llanilmoqda.
120158
- Bugun JavaScript HTML/CSS bilan to'la integratsiyalashgan va eng keng tarqalgan brauzer tili hisoblanadi.
121159
- JavaScript-ga "aylanadigan" va muayyan xususiyatlarni taqdim etadigan ko'plab tillar mavjud. Javascriptni o'zlashtirgandan so'ng kamida qisqacha ularga bir nazar tashlash tavsiya etiladi.
160+
=======
161+
- [CoffeeScript](http://coffeescript.org/) is a "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
162+
- [TypeScript](http://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
163+
- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
164+
- [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.
165+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
166+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
167+
168+
There are more. Of course, even if we use one of transpiled languages, we should also know JavaScript to really understand what we're doing.
169+
170+
## Summary
171+
172+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
173+
- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration in HTML/CSS.
174+
- 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.
175+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
# Manuals and specifications
3+
4+
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 sources.
5+
6+
## Specification
7+
8+
[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.
9+
10+
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.
11+
12+
A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
13+
14+
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>.
15+
16+
Also, if you're developing for the browser, then there are other specifications covered in the [second part](info:browser-environment) of the tutorial.
17+
18+
## Manuals
19+
20+
- **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.
21+
22+
One can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
23+
24+
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 `parseInt` function.
25+
26+
## Compatibility tables
27+
28+
JavaScript is a developing language, new features get added regularly.
29+
30+
To see their support among browser-based and other engines, see:
31+
32+
- <http://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <http://caniuse.com/#feat=cryptography>.
33+
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
34+
35+
All these resources are useful in real-life development, as they contain valuable information about language details, their support etc.
36+
37+
Please remember them (or this page) for the cases when you need in-depth information about a particular feature.

1-js/01-getting-started/2-code-editors/article.md renamed to 1-js/01-getting-started/3-code-editors/article.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ IDE loyihani yuklaydi (bu juda ko'p fayl bo'lishi mumkin), fayllar o'rtasida nav
1212

1313
Agar siz IDE ni tanlamagan bo'lsangiz, quyidagi variantlarni ko'rib chiqing:
1414

15+
<<<<<<< HEAD:1-js/01-getting-started/2-code-editors/article.md
1516
- [Visual Studio Code](https://code.visualstudio.com/) (o'zaro faoliyatli platforma, bepul).
1617
- [WebStorm](http://www.jetbrains.com/webstorm/) (o'zaro faoliyatli platforma, pullik).
1718

@@ -20,6 +21,14 @@ Windows uchun "Visual Studio" ham mavjud, "Visual Studio Code" bilan aralashmasl
2021
Ko'pgina IDElar pullik, ammo bepul sinov muddati bor. Ularning narxi malakali dasturchilarning ish haqi bilan taqqoslaganda odatda ahamiyatsiz, shuning uchun ozingizga eng qulayini tanlang.
2122

2223
## Engil muharrirlar
24+
=======
25+
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
26+
- [WebStorm](http://www.jetbrains.com/webstorm/) (cross-platform, paid).
27+
28+
For Windows, there's also "Visual Studio", not to be confused with "Visual Studio Code". "Visual Studio" is a paid and mighty Windows-only editor, well-suited for the .NET platform. It's also good at JavaScript. There's also a free version [Visual Studio Community](https://www.visualstudio.com/vs/community/).
29+
30+
Many IDEs are paid, but have a trial period. Their cost is usually negligible compared to a qualified developer's salary, so just choose the best one for you.
31+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c:1-js/01-getting-started/3-code-editors/article.md
2332
2433
"Yengil muharrirlar" IDE'lar kabi kuchli emas, lekin ular tezkor, nafis va sodda.
2534

@@ -36,10 +45,26 @@ Quyidagi variantlar sizning e'tiboringizga loyiqdir:
3645
- [Notepad++](https://notepad-plus-plus.org/) (Windows, bepul).
3746
- [Vim](http://www.vim.org/) va [Emacs](https://www.gnu.org/software/emacs/) ham zo'r agar ularni qanday foydalanishni bilsangiz.
3847

48+
<<<<<<< HEAD:1-js/01-getting-started/2-code-editors/article.md
3949
## Tortishmaylik
4050

4151
Yuqoridagi ro'yxatlardagi muharrirlar men yoki men yaxshi dasturchi deb hisoblaydigan do'stlarim uzoq vaqt davomida foydalanishgan va baxtli bo'lganlar.
4252

4353
Bizning katta dunyoda boshqa buyuk muharrirlar ham bor. Iltimos, o'zingizga eng yoqqanini tanlang.
4454

45-
Muharriri tanlash, boshqa har qanday vositasi kabi, individual va loyihalar bog'liq, odatlar, va shaxsiy imtiyozlar.
55+
Muharriri tanlash, boshqa har qanday vositasi kabi, individual va loyihalar bog'liq, odatlar, va shaxsiy imtiyozlar.
56+
=======
57+
- [Atom](https://atom.io/) (cross-platform, free).
58+
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
59+
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
60+
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
61+
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
62+
63+
## Let's not argue
64+
65+
The editors in the lists above are those that either I or my friends whom I consider good developers have been using for a long time and are happy with.
66+
67+
There are other great editors in our big world. Please choose the one you like the most.
68+
69+
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
70+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c:1-js/01-getting-started/3-code-editors/article.md
-105 KB
Binary file not shown.
-285 KB
Binary file not shown.

1-js/01-getting-started/3-devtools/article.md renamed to 1-js/01-getting-started/4-devtools/article.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,20 @@ Ishlab chiquvchi vositalarning aniq ko'rinishi sizning Chrome versiyangizga bog'
3131
- Bu erda biz qizil rangli xato xabarini ko'rishimiz mumkin. Bunday holda, skriptda noma'lum "lalala" buyrug'i mavjud.
3232
- O'ng tomonda xatolik yuzaga kelgan satr raqami bilan `bug.html:12` manbasiga bosish mumkin bo'lgan havola mavjud.
3333

34+
<<<<<<< HEAD:1-js/01-getting-started/3-devtools/article.md
3435
Xato xabari ostida ko'k `>` belgisi mavjud. Bu biz JavaScript buyruqlarini kiritishimiz mumkin bo'lgan "buyruq satri" ni belgilaydi. Ularni ishga tushirish uchun `key:Enter` tugmachasini bosing. (Ko'p qatorli buyruqlarni kiritish uchun `key:Shift+Enter` tugmachasini bosing).
36+
=======
37+
Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them.
38+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c:1-js/01-getting-started/4-devtools/article.md
3539
3640
Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter
3741
Endi biz xatolarni ko'rishimiz mumkin va bu boshlanish uchun etarli. Biz keyinchalik dasturchilar uchun ko'makchi vositalariga qaytamiz va debagging(ingliz tilidan "debugging" dastur kodidagi xatolarni tuzatish) bo'limida batafsilroq ko'rib chiqamiz<info:debugging-chrome>.
3842

43+
```smart header="Multi-line input"
44+
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
45+
46+
To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
47+
```
3948

4049
## Firefox, Edge, va boshqalar
4150

@@ -53,13 +62,17 @@ Preferences-ni oching va "Advanced" oynasiga o'ting. Pastki qismida belgilash ka
5362

5463
Endi `key:Cmd+Opt+C` tugmasini bosib konsolni faollashtirish mumkin. Bundan tashqari, "Dasturlash"("Develop") deb nomlangan yangi yuqori menyu elementiga e'tibor bering. Bu juda ko'p buyruqlar va variantlarga ega.
5564

65+
<<<<<<< HEAD:1-js/01-getting-started/3-devtools/article.md
5666
## Keyingi satrga o’tkazish imkoniyat
5767

5868
Odatda, konsolga kod satrini qo'yib, keyin `key:Enter` tugmasini bossak, u amalga oshadi.
5969

6070
Keyingi satrga o’tkazish uchun `key:Shift+Enter` bosing.
6171

6272
## Xulosa
73+
=======
74+
## Summary
75+
>>>>>>> fb4fc33a2234445808100ddc9f5e4dcec8b3d24c:1-js/01-getting-started/4-devtools/article.md
6376
6477
- Developer tools allow us to see errors, run commands, examine variables, and much more.
6578
dasturchilar uchun ko'makchi vositalari bizga xatolarni ko'rish imkonini beradi, buyruqlar ishga tushirish, o'zgaruvchilar tekshirish, va hokazo.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)