|
1 | | -# An Introduction to JavaScript |
| 1 | +# Ներածություն |
2 | 2 |
|
3 | | -Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it. |
| 3 | +Եկեք տեսնենք, թե ինչ հատկություններ ունի ՋավաՍքրիփթը, ինչի կարող ենք հասնել նրանով, և ուրիշ ինչ տեխնոլոգիաներ են դրա հետ լավ աշխատում։ |
4 | 4 |
|
5 | | -## What is JavaScript? |
| 5 | +## Ի՞նչ է ՋավաՍքրիփթը |
6 | 6 |
|
7 | | -*JavaScript* was initially created to *"make web pages alive"*. |
| 7 | +*ՋավաՍքրիփթը* սկզբից ստեղծվել է, որպեսզի *«կյանք տա կայքերին»*։ |
8 | 8 |
|
9 | | -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. |
| 9 | +Այս լեզվում ծրագրերը կոչվում են *սքրիփթներ*. Նրանք կարող են գրվել ուղղակիորեն կայքի HTML-ի մեջ և աշխատել ավտոմատ կերպով, երբ էջը բեռնվի։ |
10 | 10 |
|
11 | | -Scripts are provided and executed as plain text. They don't need special preparation or compilation to run. |
| 11 | +Սքրիփթները ներկայացվում և աշխատում են ինչպես հասարակ տեքստ։ Նրանք կարիք չունեն հատուկ նախապատրաստության աշխատելուց առաջ։ |
12 | 12 |
|
13 | | -In this aspect, JavaScript is very different from another language called [Java](https://en.wikipedia.org/wiki/Java_(programming_language)). |
| 13 | +Այս առումով ՋավաՍքրիփթը շատ է տարբերվում մեկ այլ լեզվից, որը կոչվում է [Java](https://en.wikipedia.org/wiki/Java_(programming_language)): |
14 | 14 |
|
15 | | -```smart header="Why <u>Java</u>Script?" |
16 | | -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. |
| 15 | +```smart header="Ինչու՞ <u>Ջավա</u>Սքրիփթ" |
| 16 | +Երբ ՋավաՍքրիփթը ստեղծվել էր, այն սկզբում ուրիշ անուն ուներ՝ «ԼայվՍքրիփթ» (LiveScript)։ Սակայն Ջավան շատ տարածված էր այդ ժամանակ, և որոշվեց, որ լեզվի տարածմանը կօգնի ներկայացնել նոր լեզուն ինչպես Ջավայի «կրտսեր եղբայր»։ |
17 | 17 |
|
18 | | -But as it evolved, JavaScript became a fully independent language with its own specification called [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript), and now it has no relation to Java at all. |
| 18 | +Բայց երբ այն զարգացավ, ՋավաՍքրիփթը դարձավ լիովին անկախ լեզու՝ իր հատկանշական մասերով, որոնք անվանվեցին [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript), և հիմա այն ընդհանրապես ոչ մի կապ չունի Ջավայի հետ։ |
19 | 19 | ``` |
20 | 20 |
|
21 | | -Today, JavaScript can execute not only in the browser, but also on the server, or actually on any device that has a special program called [the JavaScript engine](https://en.wikipedia.org/wiki/JavaScript_engine). |
| 21 | +Այսօր, ՋավաՍքրիփթը կարող է աշխատել ոչ միայն բրաուզերներում, այլ նաև սերվերներում, կամ ցանկացած այլ սարքերում, որոնք ունեն մի հատուկ ծրագիր, որը կոչվում է [JavaScript engine](https://en.wikipedia.org/wiki/JavaScript_engine). |
22 | 22 |
|
23 | | -The browser has an embedded engine sometimes called a "JavaScript virtual machine". |
| 23 | +Բրաուզերն ունի իր մեջ ներառված engine, որը նաև անվանում են «JavaScript virtual machine»։ |
24 | 24 |
|
25 | | -Different engines have different "codenames". For example: |
| 25 | +Տարբեր engin-ներ ունեն տարբեր «կեղծանուններ»՝ |
26 | 26 |
|
27 | | -- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera. |
28 | | -- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox. |
29 | | -- ...There are other codenames like "Trident" and "Chakra" for different versions of IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari, etc. |
| 27 | +- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- Chrome-ում և Opera-ում։ |
| 28 | +- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- Firefox-ում։ |
| 29 | +- ...Կան այլ կեղծանուններ, ինչպես «Trident» և «Chakra», IE-ի տարբերակների համար, «ChakraCore»-ը Microsoft Edge-ի համար, «Nitro» և «SquirrelFish»՝ Safari-ի, և այլն։ |
30 | 30 |
|
31 | | -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 and Opera. |
| 31 | +Նշված տերմինները պետք է հիշել, քանի որ նրանք շատ են օգտագործվում համացանցի հոդվածներում։ Մենք նույնպես կօգտագործենք։ Օրինակ, եթե նշված է, որ «Ա հատկությունը օգտագործվում է V8-ում», ապա այն հավանաբար կաշխատի Chrome-ում և Opera-ում։ |
32 | 32 |
|
33 | | -```smart header="How do engines work?" |
| 33 | +```smart header="Ինչպե՞ս են աշխատում engine-ները" |
34 | 34 |
|
35 | | -Engines are complicated. But the basics are easy. |
| 35 | +Engine-ները բարդ են, բայց հիմունքները այդքան էլ դժվար չէ հասկանալ։ |
36 | 36 |
|
37 | | -1. The engine (embedded if it's a browser) reads ("parses") the script. |
38 | | -2. Then it converts ("compiles") the script to the machine language. |
39 | | -3. And then the machine code runs, pretty fast. |
| 37 | +1. Engine-ը (ներառվածը, եթե browser-ի մասին է խոսքը) կարդում է (parse) սքրիփթը։ |
| 38 | +2. Ապա այն փոխում է (compiles) սքրիփթը մեքենայական կոդի։ |
| 39 | +3. Վերջապես մեքենան աշխատեցնում է կոդը, բավականին արագ։ |
40 | 40 |
|
41 | | -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 applies optimizations to the machine code based on that knowledge. When it's done, scripts run quite fast. |
| 41 | +Engine-ը բարեփոխումներ (optimization) է անում ամեն քայլին։ Այն նույնիսկ հետևում է պատրաստ սքրիփթի աշխատանքի ընթացքին, վերլուծում տվյալների հոսքը և կրկին բարեփոխումներ կատարում այդ գիտելիքների օգնությամբ։ Երբ դա արված է, սքրիփթը շատ արագ է աշխատում։ |
42 | 42 | ``` |
43 | 43 |
|
44 | 44 | ## What can in-browser JavaScript do? |
|
0 commit comments