Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 1-js/01-getting-started/1-intro/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ JavaScript-ի հնարավորությունները browser-ում սահման

Սա կոչվում է «Same Origin Policy»։ Երկու էջերն էլ պետք է պայմանավորվեն տվյալների փոխանակման համար և պարունակեն հատուկ JavaScript կոդ, որը կառավարում է դա։ Մենք կխոսենք դրա մասին դասընթացի մեջ։

<<<<<<< HEAD
Այս սահմանափակումը, նույնպես, օգտագործողի ապահովության համար է։ `http://anysite.com`-ից էջը, որը օգտագործողը բացել է, չպետք է հասանելիություն ունենա ուրիշ պատուհանին, օրինակ `http://gmail.com`-ին, ու գողանա տվյալներ։
- JavaScript-ը կարող է հեշտորեն կապվել ցանցով server-ի հետ, որտեղից որ կայքը գալիս է։ Բայց նրա հնարավորությունը, տվյալներ ստանալ այլ աղբյուրներից, սահմանափակ է։ Չնայած, որ հնարավոր է, սակայն այն պահանջում է հատուկ համաձայնություն (արտահայտված HTTP header-ներով) server-ից։ Կրկին, սա արված է օգտագործողի ապահովության համար։
=======
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.
- 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.
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf

![](limitations.svg)

Expand Down
4 changes: 4 additions & 0 deletions 1-js/02-first-steps/04-variables/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ let userName;
let test123;
```

<<<<<<< HEAD
Երբ փոփոխականի անունը պարունակում է մի քանի բառեր, սովորաբար օգտագործվում է [camelCase](https://en.wikipedia.org/wiki/CamelCase): camelCase-ի օգինակ է հետևյալ անունը՝ `myVeryLongName`:
=======
When the name contains multiple words, [camelCase](https://en.wikipedia.org/wiki/CamelCase) is commonly used. That is: words go one after another, with each word except the first starting with a capital letter: `myVeryLongName`.
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf

Ինչպես նշեցինք `'$'` և `'_'` նշանները ևս կարող են օգտագործվել փոփոխականների անուններում, սակայն դրանք որոշակի հատուկ իմաստ չունեն:

Expand Down
4 changes: 4 additions & 0 deletions 1-js/02-first-steps/08-operators/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ alert( c ); // 4

Կապակցումը կատարվում է աջից դեպի ձախ։ Առաջին կատարվում է ամենաաջակողմյան `2 + 2` արդահայտությունը, ապա վերագրվում է ձախ կողմի փոփոխականին․ `c`, `b` և `a`։ Ամենավերջում, բոլոր փոփոխականները հավաքվում է մեկ արժեքի մեջ։

<<<<<<< HEAD
Կրկին անգամ, ընթերցելիության նկատառումներից ելնելով, լավ է որ այն բաժանված է մի քանի տողերի․
=======
Once again, for the purposes of readability it's better to split such code into a few lines:
>>>>>>> 52c1e61915bc8970a950a3f59bd845827e49b4bf

```js
c = 2 + 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ You could note the following:

```js no-beautify
function pow(x,n) // <- no space between arguments
{ // <- figure bracket on a separate line
{ // <- curly brace on a separate line
let result=1; // <- no spaces before or after =
for(let i=0;i<n;i++) {result*=x;} // <- no spaces
// the contents of { ... } should be on a new line
Expand All @@ -13,7 +13,7 @@ function pow(x,n) // <- no space between arguments
let x=prompt("x?",''), n=prompt("n?",'') // <-- technically possible,
// but better make it 2 lines, also there's no spaces and missing ;
if (n<=0) // <- no spaces inside (n <= 0), and should be extra line above it
{ // <- figure bracket on a separate line
{ // <- curly brace on a separate line
// below - long lines can be split into multiple lines for improved readability
alert(`Power ${n} is not supported, please enter an integer number greater than zero`);
}
Expand Down
4 changes: 2 additions & 2 deletions 1-js/04-object-basics/01-object/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ As we know from the chapter <info:types>, there are eight data types in JavaScri

In contrast, objects are used to store keyed collections of various data and more complex entities. In JavaScript, objects penetrate almost every aspect of the language. So we must understand them first before going in-depth anywhere else.

An object can be created with figure brackets `{…}` with an optional list of *properties*. A property is a "key: value" pair, where `key` is a string (also called a "property name"), and `value` can be anything.
An object can be created with curly braces `{…}` with an optional list of *properties*. A property is a "key: value" pair, where `key` is a string (also called a "property name"), and `value` can be anything.

We can imagine an object as a cabinet with signed files. Every piece of data is stored in its file by the key. It's easy to find a file by its name or add/remove a file.

Expand All @@ -20,7 +20,7 @@ let user = {}; // "object literal" syntax

![](object-user-empty.svg)

Usually, the figure brackets `{...}` are used. That declaration is called an *object literal*.
Usually, the curly braces `{...}` are used. That declaration is called an *object literal*.

## Literals and properties

Expand Down
2 changes: 1 addition & 1 deletion 1-js/05-data-types/10-destructuring-assignment/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ That works, because internally a destructuring assignment works by iterating ove
````


````smart header="Assign to anything at the left-side"
````smart header="Assign to anything on the left-side"
We can use any "assignables" on the left side.
For instance, an object property:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ And here is the picture for the nested `setTimeout`:

![](settimeout-interval.svg)

**The nested `setTimeout` guarantees the fixed delay (here 100ms).**
**The nested `setTimeout` ensures a minimum delay (100ms here) between the end of one call and the beginning of the subsequent one.**

That's because a new call is planned at the end of the previous one.

Expand Down