Skip to content

Commit 3d0644c

Browse files
committed
merging all conflicts
2 parents d96b657 + 285083f commit 3d0644c

File tree

90 files changed

+783
-485
lines changed

Some content is hidden

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

90 files changed

+783
-485
lines changed

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,26 @@ Browser-ն ունի իր մեջ ներառված engine, որը նաև անվա
3434
3535
Engine-ները բարդ են, բայց հիմունքները այդքան էլ դժվար չէ հասկանալ։
3636
37+
<<<<<<< HEAD
3738
1. Engine-ը (ներառվածը, եթե browser-ի մասին է խոսքը) կարդում է (parse) script-ը։
3839
2. Ապա այն փոխում է (compile) script-ը մեքենայական կոդի։
3940
3. Վերջապես մեքենան աշխատեցնում է կոդը, բավականին արագ։
41+
=======
42+
1. The engine (embedded if it's a browser) reads ("parses") the script.
43+
2. Then it converts ("compiles") the script to machine code.
44+
3. And then the machine code runs, pretty fast.
45+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
4046
4147
Engine-ը բարեփոխումներ (optimization) է անում ամեն քայլին։ Այն նույնիսկ հետևում է պատրաստ script-ի աշխատանքի ընթացքին, վերլուծում տվյալների հոսքը և կրկին բարեփոխումներ կատարում այդ գիտելիքների օգնությամբ։ Երբ դա արված է, script-ը շատ արագ է աշխատում։
4248
```
4349

4450
## Ի՞նչ է կարող browser-ի միջի JavaScript-ը անել
4551

52+
<<<<<<< HEAD
4653
Ժամանակակից JavaScript-ը «ապահով» ծրագրավորման լեզու է։ Այն չի տրամադրում low-level հասանելիություն հիշողությանը կան CPU-ին, քանի որ սկզբնապես ստեղծված է եղել browser-ների համար, որոնք դրա կարիքը չունեն
54+
=======
55+
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.
56+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
4757
4858
JavaScript-ի հնարավորությունները մեծ մասով կախված են միջավայրից, որում այն աշխատում է։ Օրինակ՝ [Node.js](https://wikipedia.org/wiki/Node.js)-ը ունի ֆունկցիաներ, որոնք թույլատրում են JavaScript-ին կարդալ կամ գրել որևէ ֆայլի մեջ, կատարել ցանցային հարցումներ և այլն։
4959

@@ -59,14 +69,19 @@ Browser-ի միջի JavaScript-ը կարող է անել ամեն ինչ կապ
5969

6070
## Ի՞նչ չի կարող JavaScript-ը անել
6171

72+
<<<<<<< HEAD
6273
JavaScript-ի հնարավորությունները browser-ում սահմանափակ են ապահովության նկատառումներով։ Նպատակն է կանխել չար կայքերի հասանելիությունը օգտագործողի անձնական տվյալներին։
74+
=======
75+
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.
76+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
6377
6478
Այսպիսի սահմանափակումների օրինակներ են՝
6579

6680
- JavaScript-ը էջում չի կարող կարդալ գամ գրել որևը կոշտ սկավառակը ֆայլի մեջ, պատճենել դրանք կամ աշխատեցնել ծրագրեր։ Այն չունի ուղիղ հասանելիություն օպերացիոն համակարգի ֆունկցիաներին։
6781

6882
Ժամանակակից browser-ները թույլ են տալիս աշխատել ֆայլերի հետ, բայց հասանելիությունը տրամադրվում է միայն որոշակի դեպքերում, օրինակ՝ երբ օգտագործողը «նետում» է ֆայլերը պատուհանի մեջ կամ ընտրում `<input>` tag-ի միջոցով։
6983

84+
<<<<<<< HEAD
7085
Գոյություն ունեն մեթոդներ տեսախցիկի կամ խոսափողի հասանելիություն տրամադրելու, բայց նրանք պահանջում են օգտագործողի կողմից կատարված կամավոր գործողություն, որպեսզի էջը գաղտնիաբար չօգտագործի տեսախցիկը և տվյալներ ուղարկի [NSA](https://en.wikipedia.org/wiki/National_Security_Agency)-ին։
7186
- Տարբեր պատուհաններ հիմնականում չգիտեն իրար մասին։ Որոշ դեպքերում, սակայն, գիտեն, օրինակ՝ երբ մի էջը օգտագործում է JavaScript, որ բացի մյուսը։ Սակայն նույնիսկ այս դեպքում, մի էջի JavaScript-ը չի կարող կառավարել մյուսը, եթե նրանք տարբեր աղբյուրներից են։
7287

@@ -78,6 +93,19 @@ JavaScript-ի հնարավորությունները browser-ում սահման
7893
![](limitations.svg)
7994

8095
Այսպիսի սահմանափակումներ չկան, երբ JavaScript-ը օգտագործվում է browser-ից դուրս, օրինակ՝ server-ներում։ Ժամանակակից browser-ները նույնպես ունեն plug-in-ներ, որոնք կարող են հարցնել հավելյալ թույլտվություններ։
96+
=======
97+
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).
98+
- 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).
99+
100+
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.
101+
102+
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.
103+
- 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 crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
104+
105+
![](limitations.svg)
106+
107+
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.
108+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
81109
82110
## Ի՞նչն է դարձնում JavaScript-ը յուրօրինակ
83111

@@ -92,20 +120,29 @@ JavaScript-ը միակ borwser-ային տեխնոլոգիան է, որը ներ
92120

93121
Ահա, թե ինչն է սարքում դրան այսքան տարբերվող։ Ահա, թե ինչու է ամենատարածված գործիքը browser-ային ինտերֆեյսեր սարքելու համար։
94122

123+
<<<<<<< HEAD
95124
Այսպիսով, JavaScript-ը թույլ է տալիս ստեղծել server-ներ, mobile ծրագրեր և այլն։
125+
=======
126+
That said, JavaScript can be used to create servers, mobile applications, etc.
127+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
96128
97129
## Լեզուներ՝ JavaScript-ի «վրա»
98130

99131
JavaScript-ի գրելաձևը բոլորին չի բավարարում։ Տարբեր մարդիկ ցանկանում են տարբեր հատկություններ։
100132

101133
Դա սպասելի է, քանի որ ծրագրերն ու պահանջները տարբեր են բոլորի մոտ։
102134

135+
<<<<<<< HEAD
103136
Վերջերս բազում նոր լեզուներ են առաջացել, որոնք *transpile* են լինում (փոխվում) JavaScript-ի մինչև աշխատելը։
137+
=======
138+
So, recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
139+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
104140
105141
Ժամանակակից գործիքները դարձնում են փոփոխվելը շատ արագ և թափանցիկ, թույլատրելով ծրագրավորողներին աշխատել այլ լեզվով, և ավտո-փոխակերպում են այն JavaScript-ի աննկատ կերպով։
106142

107143
Այսպիսի լեզուների օրինակներ են՝
108144

145+
<<<<<<< HEAD
109146
- [CoffeeScript](http://coffeescript.org/)-ը ունի կարճ գրելաձև, թույլ է տալիս ծրագրավորողին գրել ավելի մաքուր և ճշգրիտ կոդ։ Հիմնականում Ruby-ի ծրագրավորողներն են հավանում այն։
110147
- [TypeScript](http://www.typescriptlang.org/)-ը կենտրոնացած է խիստ տիպերի ներմուծման վրա, հեշտացնելով դժվար համակարգերի ծրագրավորումն ու հետագա ապահովումը։ Այն ստեղծվել է Microsoft-ի կողմից։
111148
- [Flow](http://flow.org/)-ը նույնպես ավելացնում է տվյալների տիպեր, սակայն այլ կերպ է աշխատում։ Ստեղծված է Facebook-ի կողմից։
@@ -114,6 +151,16 @@ JavaScript-ի գրելաձևը բոլորին չի բավարարում։ Տար
114151
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) ժամանակակից, հակիրճ և ապահով ծրագրավորման լեզու է, կա հնարավորություն կոդը թարգմանելու նաև browser-ների or Node-ի համար։
115152

116153
Կան ուրիշներ։ Իհարկե, եթե նույնիսկ օգտագործենք թարգմանված լեզուները, պետք է իմանանք JavaScript, որպեսզի հասկանանք՝ ինչ ենք անում։
154+
=======
155+
- [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.
156+
- [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.
157+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
158+
- [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.
159+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
160+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
161+
162+
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.
163+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
117164
118165
## Ամփոփում
119166

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,34 @@ IDE-ների և «թեթև խմբագրիչներ»-ի հիմնական տարբ
2929

3030
Գործնականում թեթև խմբագրիչները կարող են ունենալ բազմաթիվ հավելումներ (plugins), որոնք կարող են խմբագրիչի հնարավորություններ մեծացնել, այնպես որ թեթև խմբագրիչների և IDE-ների մեջ խիստ տարանջատում չկա:
3131

32+
<<<<<<< HEAD
3233
Հետևյալ խնբագրիչներն արժանի են Ձեր ուշադրությանը.
3334

3435
- [Atom](https://atom.io/) (հասանելի է տարբեր հարթակների համար, անվճար է).
3536
- [Sublime Text](http://www.sublimetext.com) (հասանելի է տարբեր հարթակների համար, վճարովի է).
3637
- [Notepad++](https://notepad-plus-plus.org/) (Windows, անվճար է).
3738
- [Vim](http://www.vim.org/), [Emacs](https://www.gnu.org/software/emacs/).
39+
=======
40+
There are many options, for instance:
41+
42+
- [Sublime Text](https://www.sublimetext.com/) (cross-platform, shareware).
43+
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
44+
- [Vim](https://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
45+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
3846
3947
## Այլ խմբագրիչներ
4048

49+
<<<<<<< HEAD
4150
Վերոնշյալ խմբագրիչները առավել հաճախ կիրառվողներից են: Գոյություն ունեն նաև այլ խմբագրիչներ: Խմբագրիչի (ինչպես մնացած գործիքների) ընտրությունը Ձեր անձնական գործն է և կարող է կախված լինել նախագծից, սովորություններից, կամ անձնական նախընտրություններից:
51+
=======
52+
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.
53+
54+
There are other great editors in our big world. Please choose the one you like the most.
55+
56+
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
57+
58+
The author's personal opinion:
59+
60+
- I'd use [Visual Studio Code](https://code.visualstudio.com/) if I develop mostly frontend.
61+
- Otherwise, if it's mostly another language/platform and partially frontend, then consider other editors, such as XCode (Mac), Visual Studio (Windows) or Jetbrains family (Webstorm, PHPStorm, RubyMine etc, depending on the language).
62+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c

1-js/02-first-steps/04-variables/3-uppercast-constant/task.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,24 @@ const birthday = '18.04.1982';
1212
const age = someCode(birthday);
1313
```
1414

15+
<<<<<<< HEAD
1516
Այստեղ ունենք `birthday` հաստատունը, որն ամսաթիվ է պարունակում, իսկ `age`-ը հաշվարկվում է `birthday`-ից ինչ-որ ֆուկցիայի միջոցով (մանրամասները նշված չեն հակիրճության համար):
17+
=======
18+
Here we have a constant `birthday` for the date, and also the `age` constant.
19+
20+
The `age` is calculated from `birthday` using `someCode()`, which means a function call that we didn't explain yet (we will soon!), but the details don't matter here, the point is that `age` is calculated somehow based on the `birthday`.
21+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
1622
1723
Ճիշտ կլինե՞ր մեծատառերով գրել `birthday`-ը: Իսկ `age`-ը՞: Կամ գուցե երկու՞սն էլ:
1824

1925
```js
26+
<<<<<<< HEAD
2027
const BIRTHDAY = '18.04.1982'; // սա՞ գրել մեծատառերով
2128

2229
const AGE = someCode(BIRTHDAY); // թե՞ age-ը
23-
```
30+
=======
31+
const BIRTHDAY = '18.04.1982'; // make birthday uppercase?
2432

33+
const AGE = someCode(BIRTHDAY); // make age uppercase?
34+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
35+
```

1-js/02-first-steps/04-variables/article.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,21 @@ let message = "That"; // SyntaxError: 'message' has already been declared
150150
Այսպիսով՝ մենք պետք է փոփոխականները հայտարարենք մեկ անգամ, այնուհետև օգտագործենք առանց `let` հիմնաբառի:
151151
````
152152

153+
<<<<<<< HEAD
153154
```smart header="Ֆունկցիոնալ լեզուներ"
154155
Հետաքրքիր է իմանալ, որ գոյություն ունեն [ֆունկցիոնալ](https://hy.wikipedia.org/wiki/%D5%96%D5%B8%D6%82%D5%B6%D5%AF%D6%81%D5%AB%D5%B8%D5%B6%D5%A1%D5%AC_%D5%AE%D6%80%D5%A1%D5%A3%D6%80%D5%A1%D5%BE%D5%B8%D6%80%D5%B8%D6%82%D5%B4) ծրագրավորման լեզուներ, օրինակ՝ [Scala](http://www.scala-lang.org/), [Erlang](http://www.erlang.org/), որոնք արգելում են փոփոխականների արժեքների փոփոխությունները:
156+
=======
157+
```smart header="Functional languages"
158+
It's interesting to note that there exist so-called [pure functional](https://en.wikipedia.org/wiki/Purely_functional_programming) programming languages, such as [Haskell](https://en.wikipedia.org/wiki/Haskell), that forbid changing variable values.
159+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
155160
156161
Նման լեզուներում, երբ արժեքները տեղադրվում են «արկղների» դրանք այլևս փոխել հնարավոր չէ: Եթե անհրաժեշտ է պահել այլ արժեք, լեզուն ստիպում է ստեղծել նոր արկղ (հայտարարել նոր փոփոխական):
157162
163+
<<<<<<< HEAD
158164
Չնայած առաջին հայացքից այդ պահվածքը կարող է տարօրինակ թվալ, բայց այդ լեզուները իրոք օգտագործվում են լուրջ նախագծեր մշակելու համար: Ավելին, կան ոլորտներ (օր.՝ զուգահեռ հաշվարկներ), որտեղ այս սահմանափակումները շահավետ են: Խորհուրդ է տրվում ուսումնասիրել նման ծրագրավորման լեզու (նույնիսկ եթե չեք պատրաստվում օգտագործել) «աշխարհայացք» զարգացնելու համար:
165+
=======
166+
Though it may seem a little odd at first sight, these languages are quite capable of serious development. More than that, there are areas like parallel computations where this limitation confers certain benefits.
167+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
159168
```
160169

161170
## Փոփոխականների անվանումը [#variable-naming]
@@ -197,8 +206,13 @@ let my-name; // գծիկները թույլատրված չեն անուններ
197206
`apple` և `AppLE` անուններով փոփոխականները երկու տարբեր փոփոխականներ են:
198207
```
199208

209+
<<<<<<< HEAD
200210
````smart header="Ոչ լատիներեն տառերը թույլատրված են, բայց խորհուրդ չի տրվում դրանք օգտագործել"
201211
Հնարավոր է օգտագործել ցանկացած լեզվի տառեր, օրինակ՝
212+
=======
213+
````smart header="Non-Latin letters are allowed, but not recommended"
214+
It is possible to use any language, including cyrillic letters, Chinese logograms and so on, like this:
215+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
202216
203217
```js
204218
let имя = '...';

1-js/02-first-steps/05-types/article.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ alert(age); // «undefined»
225225
226226
## typeof օպերատորը [#type-typeof]
227227
228+
<<<<<<< HEAD
228229
`typeof` օպերատորը վերադարձնում է իր արգումենտի տիպը։ Այն օգտակար է, երբ մենք ուզում ենք մշակել տարբեր տիպերի արժեքները տարբեր կերպով, կամ պարզեպես արագ ստուգման կարիք կա։
230+
=======
231+
The `typeof` operator returns the type of the operand. It's useful when we want to process values of different types differently or just want to do a quick check.
232+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
229233
230234
`typeof x`-ի կանչը վերադարձնում է տող, որը պարունակում է տիպի անվանումը․
231235

0 commit comments

Comments
 (0)