diff --git a/1-js/02-first-steps/04-variables/article.md b/1-js/02-first-steps/04-variables/article.md index 6bb74ac02..35ef7c961 100644 --- a/1-js/02-first-steps/04-variables/article.md +++ b/1-js/02-first-steps/04-variables/article.md @@ -205,7 +205,11 @@ let userName; let test123; ``` +<<<<<<< HEAD Когато името съдържа много думи, предимно се използва [camelCase](https://en.wikipedia.org/wiki/CamelCase). Това, camelCase, е практика на писане на фрази като думите се пишат едно след други слято като всяка дума освен първата започва на главна буква: `многоДълъгИзразОтДумиКатоТози`. +======= +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`. +>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11 Какво е интересното тук -- символа `'$'` и долната черта `'_'` също могат да се използват в имената. Те са обикновенни символи, също като буквите, без никакво специално значение. diff --git a/1-js/02-first-steps/08-operators/article.md b/1-js/02-first-steps/08-operators/article.md index 532bbf029..4f374634b 100644 --- a/1-js/02-first-steps/08-operators/article.md +++ b/1-js/02-first-steps/08-operators/article.md @@ -306,7 +306,13 @@ alert( b ); // 4 alert( c ); // 4 ``` +<<<<<<< HEAD Веригата от присвоявания се изпълнява от дясно на ляво. Първо, най-десният израз `2 + 2` е изпълнен и е присвоен от променливите отляво: `c`, `b` и `a`. Накрая, всички променливи споделят една стойност. +======= +Chained assignments evaluate from right to left. First, the rightmost expression `2 + 2` is evaluated and then assigned to the variables on the left: `c`, `b` and `a`. At the end, all the variables share a single value. + +Once again, for the purposes of readability it's better to split such code into a few lines: +>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11 Още веднъж, за целите на четимостта е по-добре да разделите такъв код на няколко реда: ```js diff --git a/1-js/02-first-steps/09-comparison/article.md b/1-js/02-first-steps/09-comparison/article.md index c220bdd1e..6817b46a9 100644 --- a/1-js/02-first-steps/09-comparison/article.md +++ b/1-js/02-first-steps/09-comparison/article.md @@ -215,8 +215,16 @@ alert( undefined == 0 ); // невярно (3) ## Обобщение +<<<<<<< HEAD - Операторите за сравнение връщат булева стойност. - Символните низове(текст) се сравняват символ по символ в "лексикографски" ред. - Когато се сравняват стойности от различни типове, те се преобразуват в числа (с изключение на строга проверка за равенство). - Стойностите `null` и `undefined` са равни `==` само една на друга, и на никоя друга стойност. - Бъдете внимателни, когато използвате сравнения като `>` или `<` с променливи, които понякога могат да бъдат `null/undefined`. Проверката за `null/undefined` отделно е добра идея. +======= +- Comparison operators return a boolean value. +- Strings are compared letter-by-letter in the "dictionary" order. +- When values of different types are compared, they get converted to numbers (with the exclusion of a strict equality check). +- The values `null` and `undefined` are equal `==` to themselves and each other, but do not equal any other value. +- Be careful when using comparisons like `>` or `<` with variables that can occasionally be `null/undefined`. Checking for `null/undefined` separately is a good idea. +>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11 diff --git a/1-js/03-code-quality/02-coding-style/1-style-errors/solution.md b/1-js/03-code-quality/02-coding-style/1-style-errors/solution.md index 821682695..1cc92b4ba 100644 --- a/1-js/03-code-quality/02-coding-style/1-style-errors/solution.md +++ b/1-js/03-code-quality/02-coding-style/1-style-errors/solution.md @@ -2,6 +2,7 @@ Може да забележите следното: ```js no-beautify +<<<<<<< HEAD function pow(x,n) // <- няма разстояние между аргументите { // <- фигуративната скоба е на нов ред let result=1; // <- няма разстояние преди и след знака = @@ -16,6 +17,22 @@ if (n<0) // <- няма разстояние вътре в скобите (n < { // <- фигуративната скоба е на отделен ред // долу - дългите редове може да се разделят на множество редове с по-мака дължина, за по-добра четимост alert(`Степента ${n} не се поддържа, моля въведете цяло число, по-голямо от нула`); +======= +function pow(x,n) // <- no space between arguments +{ // <- curly brace on a separate line + let result=1; // <- no spaces before or after = + for(let i=0;i>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11 } else // <- може да се напише на един ред като "} else {" { diff --git a/1-js/04-object-basics/01-object/article.md b/1-js/04-object-basics/01-object/article.md index 6241d5c4b..ec0d03223 100644 --- a/1-js/04-object-basics/01-object/article.md +++ b/1-js/04-object-basics/01-object/article.md @@ -6,7 +6,13 @@ Обект може да бъде създаден с фигурни скоби `{…}` с незадължителен списък на *свойства*. Свойството е двойка от "ключ: стойност", където `ключът` е низ (също се нарича и "име на свойството"), и `стойност`, което може да бъде всичко. +<<<<<<< HEAD Можем да си представим обект като шкаф с подписани файлове. Всяка част от данните се съхранява в своя файл с ключ. Лесно е да намерите файл по неговото име или да добавите / премахнете даден файл. +======= +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. +>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11 ![](object.svg) @@ -19,7 +25,11 @@ let user = {}; // синстаксиса "литерал на обект" ![](object-user-empty.svg) +<<<<<<< HEAD Обикновено се използват фигурните скоби `{...}`. Тази деклерация се нарича *литерал на обект*. +======= +Usually, the curly braces `{...}` are used. That declaration is called an *object literal*. +>>>>>>> ff804bc19351b72bc5df7766f4b9eb8249a3cb11 ## Литерали и свойства diff --git a/1-js/05-data-types/04-array/article.md b/1-js/05-data-types/04-array/article.md index 42a648709..daa9d59be 100644 --- a/1-js/05-data-types/04-array/article.md +++ b/1-js/05-data-types/04-array/article.md @@ -100,7 +100,7 @@ Let's say we want the last element of the array. Some programming languages allow the use of negative indexes for the same purpose, like `fruits[-1]`. -Although, in JavaScript it won't work. The result will be `undefined`, because the index in square brackets is treated literally. +However, in JavaScript it won't work. The result will be `undefined`, because the index in square brackets is treated literally. We can explicitly calculate the last element index and then access it: `fruits[fruits.length - 1]`. diff --git a/1-js/05-data-types/10-destructuring-assignment/article.md b/1-js/05-data-types/10-destructuring-assignment/article.md index 0c52741d1..c8693b2c4 100644 --- a/1-js/05-data-types/10-destructuring-assignment/article.md +++ b/1-js/05-data-types/10-destructuring-assignment/article.md @@ -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: diff --git a/1-js/06-advanced-functions/08-settimeout-setinterval/article.md b/1-js/06-advanced-functions/08-settimeout-setinterval/article.md index f96959988..fc033c5e2 100644 --- a/1-js/06-advanced-functions/08-settimeout-setinterval/article.md +++ b/1-js/06-advanced-functions/08-settimeout-setinterval/article.md @@ -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.