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
+47Lines changed: 47 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,16 +34,26 @@ Browser-ն ունի իր մեջ ներառված engine, որը նաև անվա
34
34
35
35
Engine-ները բարդ են, բայց հիմունքները այդքան էլ դժվար չէ հասկանալ։
36
36
37
+
<<<<<<< HEAD
37
38
1. Engine-ը (ներառվածը, եթե browser-ի մասին է խոսքը) կարդում է (parse) script-ը։
38
39
2. Ապա այն փոխում է (compile) script-ը մեքենայական կոդի։
39
40
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
40
46
41
47
Engine-ը բարեփոխումներ (optimization) է անում ամեն քայլին։ Այն նույնիսկ հետևում է պատրաստ script-ի աշխատանքի ընթացքին, վերլուծում տվյալների հոսքը և կրկին բարեփոխումներ կատարում այդ գիտելիքների օգնությամբ։ Երբ դա արված է, script-ը շատ արագ է աշխատում։
42
48
```
43
49
44
50
## Ի՞նչ է կարող browser-ի միջի JavaScript-ը անել
45
51
52
+
<<<<<<< HEAD
46
53
Ժամանակակից 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
47
57
48
58
JavaScript-ի հնարավորությունները մեծ մասով կախված են միջավայրից, որում այն աշխատում է։ Օրինակ՝ [Node.js](https://wikipedia.org/wiki/Node.js)-ը ունի ֆունկցիաներ, որոնք թույլատրում են JavaScript-ին կարդալ կամ գրել որևէ ֆայլի մեջ, կատարել ցանցային հարցումներ և այլն։
49
59
@@ -59,14 +69,19 @@ Browser-ի միջի JavaScript-ը կարող է անել ամեն ինչ կապ
59
69
60
70
## Ի՞նչ չի կարող JavaScript-ը անել
61
71
72
+
<<<<<<< HEAD
62
73
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
63
77
64
78
Այսպիսի սահմանափակումների օրինակներ են՝
65
79
66
80
- JavaScript-ը էջում չի կարող կարդալ գամ գրել որևը կոշտ սկավառակը ֆայլի մեջ, պատճենել դրանք կամ աշխատեցնել ծրագրեր։ Այն չունի ուղիղ հասանելիություն օպերացիոն համակարգի ֆունկցիաներին։
67
81
68
82
Ժամանակակից browser-ները թույլ են տալիս աշխատել ֆայլերի հետ, բայց հասանելիությունը տրամադրվում է միայն որոշակի դեպքերում, օրինակ՝ երբ օգտագործողը «նետում» է ֆայլերը պատուհանի մեջ կամ ընտրում `<input>` tag-ի միջոցով։
69
83
84
+
<<<<<<< HEAD
70
85
Գոյություն ունեն մեթոդներ տեսախցիկի կամ խոսափողի հասանելիություն տրամադրելու, բայց նրանք պահանջում են օգտագործողի կողմից կատարված կամավոր գործողություն, որպեսզի էջը գաղտնիաբար չօգտագործի տեսախցիկը և տվյալներ ուղարկի [NSA](https://en.wikipedia.org/wiki/National_Security_Agency)-ին։
71
86
- Տարբեր պատուհաններ հիմնականում չգիտեն իրար մասին։ Որոշ դեպքերում, սակայն, գիտեն, օրինակ՝ երբ մի էջը օգտագործում է JavaScript, որ բացի մյուսը։ Սակայն նույնիսկ այս դեպքում, մի էջի JavaScript-ը չի կարող կառավարել մյուսը, եթե նրանք տարբեր աղբյուրներից են։
Այսպիսի սահմանափակումներ չկան, երբ 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
+

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
81
109
82
110
## Ի՞նչն է դարձնում JavaScript-ը յուրօրինակ
83
111
@@ -92,20 +120,29 @@ JavaScript-ը միակ borwser-ային տեխնոլոգիան է, որը ներ
92
120
93
121
Ահա, թե ինչն է սարքում դրան այսքան տարբերվող։ Ահա, թե ինչու է ամենատարածված գործիքը browser-ային ինտերֆեյսեր սարքելու համար։
94
122
123
+
<<<<<<< HEAD
95
124
Այսպիսով, JavaScript-ը թույլ է տալիս ստեղծել server-ներ, mobile ծրագրեր և այլն։
125
+
=======
126
+
That said, JavaScript can be used to create servers, mobile applications, etc.
127
+
>>>>>>> 285083fc71ee3a7cf55fd8acac9c91ac6f62105c
96
128
97
129
## Լեզուներ՝ JavaScript-ի «վրա»
98
130
99
131
JavaScript-ի գրելաձևը բոլորին չի բավարարում։ Տարբեր մարդիկ ցանկանում են տարբեր հատկություններ։
100
132
101
133
Դա սպասելի է, քանի որ ծրագրերն ու պահանջները տարբեր են բոլորի մոտ։
102
134
135
+
<<<<<<< HEAD
103
136
Վերջերս բազում նոր լեզուներ են առաջացել, որոնք *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
104
140
105
141
Ժամանակակից գործիքները դարձնում են փոփոխվելը շատ արագ և թափանցիկ, թույլատրելով ծրագրավորողներին աշխատել այլ լեզվով, և ավտո-փոխակերպում են այն JavaScript-ի աննկատ կերպով։
106
142
107
143
Այսպիսի լեզուների օրինակներ են՝
108
144
145
+
<<<<<<< HEAD
109
146
-[CoffeeScript](http://coffeescript.org/)-ը ունի կարճ գրելաձև, թույլ է տալիս ծրագրավորողին գրել ավելի մաքուր և ճշգրիտ կոդ։ Հիմնականում Ruby-ի ծրագրավորողներն են հավանում այն։
110
147
-[TypeScript](http://www.typescriptlang.org/)-ը կենտրոնացած է խիստ տիպերի ներմուծման վրա, հեշտացնելով դժվար համակարգերի ծրագրավորումն ու հետագա ապահովումը։ Այն ստեղծվել է Microsoft-ի կողմից։
111
148
-[Flow](http://flow.org/)-ը նույնպես ավելացնում է տվյալների տիպեր, սակայն այլ կերպ է աշխատում։ Ստեղծված է Facebook-ի կողմից։
@@ -114,6 +151,16 @@ JavaScript-ի գրելաձևը բոլորին չի բավարարում։ Տար
114
151
-[Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) ժամանակակից, հակիրճ և ապահով ծրագրավորման լեզու է, կա հնարավորություն կոդը թարգմանելու նաև browser-ների or Node-ի համար։
115
152
116
153
Կան ուրիշներ։ Իհարկե, եթե նույնիսկ օգտագործենք թարգմանված լեզուները, պետք է իմանանք 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.
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/3-code-editors/article.md
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -29,13 +29,34 @@ IDE-ների և «թեթև խմբագրիչներ»-ի հիմնական տարբ
29
29
30
30
Գործնականում թեթև խմբագրիչները կարող են ունենալ բազմաթիվ հավելումներ (plugins), որոնք կարող են խմբագրիչի հնարավորություններ մեծացնել, այնպես որ թեթև խմբագրիչների և IDE-ների մեջ խիստ տարանջատում չկա:
31
31
32
+
<<<<<<< HEAD
32
33
Հետևյալ խնբագրիչներն արժանի են Ձեր ուշադրությանը.
33
34
34
35
-[Atom](https://atom.io/) (հասանելի է տարբեր հարթակների համար, անվճար է).
35
36
-[Sublime Text](http://www.sublimetext.com) (հասանելի է տարբեր հարթակների համար, վճարովի է).
36
37
-[Notepad++](https://notepad-plus-plus.org/) (Windows, անվճար է).
-[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
38
46
39
47
## Այլ խմբագրիչներ
40
48
49
+
<<<<<<< HEAD
41
50
Վերոնշյալ խմբագրիչները առավել հաճախ կիրառվողներից են: Գոյություն ունեն նաև այլ խմբագրիչներ: Խմբագրիչի (ինչպես մնացած գործիքների) ընտրությունը Ձեր անձնական գործն է և կարող է կախված լինել նախագծից, սովորություններից, կամ անձնական նախընտրություններից:
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).
Այստեղ ունենք `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
16
22
17
23
Ճիշտ կլինե՞ր մեծատառերով գրել `birthday`-ը: Իսկ `age`-ը՞: Կամ գուցե երկու՞սն էլ:
18
24
19
25
```js
26
+
<<<<<<<HEAD
20
27
constBIRTHDAY='18.04.1982'; // սա՞ գրել մեծատառերով
21
28
22
29
constAGE=someCode(BIRTHDAY); // թե՞ age-ը
23
-
```
30
+
=======
31
+
constBIRTHDAY='18.04.1982'; // make birthday uppercase?
24
32
33
+
constAGE=someCode(BIRTHDAY); // make age uppercase?
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/04-variables/article.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -150,12 +150,21 @@ let message = "That"; // SyntaxError: 'message' has already been declared
150
150
Այսպիսով՝ մենք պետք է փոփոխականները հայտարարենք մեկ անգամ, այնուհետև օգտագործենք առանց `let` հիմնաբառի:
151
151
````
152
152
153
+
<<<<<<< HEAD
153
154
```smart header="Ֆունկցիոնալ լեզուներ"
154
155
Հետաքրքիր է իմանալ, որ գոյություն ունեն [ֆունկցիոնալ](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
155
160
156
161
Նման լեզուներում, երբ արժեքները տեղադրվում են «արկղների» դրանք այլևս փոխել հնարավոր չէ: Եթե անհրաժեշտ է պահել այլ արժեք, լեզուն ստիպում է ստեղծել նոր արկղ (հայտարարել նոր փոփոխական):
157
162
163
+
<<<<<<< HEAD
158
164
Չնայած առաջին հայացքից այդ պահվածքը կարող է տարօրինակ թվալ, բայց այդ լեզուները իրոք օգտագործվում են լուրջ նախագծեր մշակելու համար: Ավելին, կան ոլորտներ (օր.՝ զուգահեռ հաշվարկներ), որտեղ այս սահմանափակումները շահավետ են: Խորհուրդ է տրվում ուսումնասիրել նման ծրագրավորման լեզու (նույնիսկ եթե չեք պատրաստվում օգտագործել) «աշխարհայացք» զարգացնելու համար:
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
159
168
```
160
169
161
170
## Փոփոխականների անվանումը [#variable-naming]
@@ -197,8 +206,13 @@ let my-name; // գծիկները թույլատրված չեն անուններ
197
206
`apple` և `AppLE` անուններով փոփոխականները երկու տարբեր փոփոխականներ են:
198
207
```
199
208
209
+
<<<<<<< HEAD
200
210
````smart header="Ոչ լատիներեն տառերը թույլատրված են, բայց խորհուրդ չի տրվում դրանք օգտագործել"
201
211
Հնարավոր է օգտագործել ցանկացած լեզվի տառեր, օրինակ՝
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:
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/05-types/article.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,11 @@ alert(age); // «undefined»
225
225
226
226
## typeof օպերատորը [#type-typeof]
227
227
228
+
<<<<<<< HEAD
228
229
`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
229
233
230
234
`typeof x`-ի կանչը վերադարձնում է տող, որը պարունակում է տիպի անվանումը․
0 commit comments