diff --git a/1-js/02-first-steps/09-comparison/article.md b/1-js/02-first-steps/09-comparison/article.md index c220bdd1e..d044acc9e 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. +>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3 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]`.