Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a78e9d5
Change potentially confusing statement
romanstetsyk Oct 1, 2022
8c256ae
Update article.md
nikolai-chernolutskii Jan 29, 2023
9a90dc1
Fix typo
scottwright-dev Jan 31, 2023
55269bb
Update grammar
gitwinst Mar 2, 2023
c07df98
Update article.md
audiodude Jul 23, 2024
a1257db
clarify wording about null and undefined equality in JS
Lk-ux Nov 9, 2025
aa3841a
Update 1-js/02-first-steps/09-comparison/article.md
smith558 Nov 12, 2025
5e893cf
Merge pull request #3902 from Lk-ux/patch-2
smith558 Nov 12, 2025
9ef986e
minor grammar improvement
cathoderay Nov 20, 2025
d78b01e
Merge pull request #3906 from cathoderay/master
smith558 Nov 20, 2025
87bfe5b
docs: replace figure brackets with curly braces across all occurrences
swapnasahoo Feb 17, 2026
0354326
Merge branch 'master' into setTimeout
smith558 Feb 25, 2026
c0904ea
Merge pull request #3210 from romanstetsyk/setTimeout
smith558 Feb 25, 2026
b76f5c7
Merge pull request #3347 from scottwright-dev/patch-1
smith558 Feb 25, 2026
c6695ed
Merge pull request #3389 from gitwinst/patch-1
smith558 Feb 25, 2026
f3e09c8
Merge branch 'master' into docs/figure-brackets-to-curly-braces
swapnasahoo Feb 26, 2026
953c2db
Improve coding style
smith558 Feb 26, 2026
7f94b0a
Merge pull request #3936 from swapnasahoo/docs/figure-brackets-to-cur…
smith558 Feb 26, 2026
ff804bc
Merge pull request #3341 from nikolai-chernolutskii/patch-3
smith558 Feb 26, 2026
c6f645c
Merge branch 'master' into patch-1
smith558 Mar 2, 2026
52c1e61
Merge pull request #3724 from audiodude/patch-1
smith558 Mar 2, 2026
a197375
Convert prompt inputs to numbers with unary plus
Lk-ux Jul 4, 2026
f7922ed
Fix Prism API name: highlightElem -> highlightElement
Violet-Bora-Lee Jul 19, 2026
725653f
Merge pull request #3980 from Violet-Bora-Lee/fix-prism-highlight-ele…
iliakan Jul 19, 2026
2020876
Merge pull request #3977 from Lk-ux/patch-3
smith558 Jul 25, 2026
e8592af
merging all conflicts
iliakan Aug 3, 2026
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
2 changes: 1 addition & 1 deletion 1-js/01-getting-started/1-intro/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Examples of such restrictions include:
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.

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 crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
- 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.

![](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 @@ -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`.
>>>>>>> 20208769e528337949e946f526534d61d38bac47

Какво е интересното тук -- символа `'$'` и долната черта `'_'` също могат да се използват в имената. Те са обикновенни символи, също като буквите, без никакво специално значение.

Expand Down
6 changes: 6 additions & 0 deletions 1-js/02-first-steps/08-operators/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
>>>>>>> 20208769e528337949e946f526534d61d38bac47

Още веднъж, за целите на четимостта е по-добре да разделите такъв код на няколко реда:
```js
Expand Down
8 changes: 8 additions & 0 deletions 1-js/02-first-steps/09-comparison/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
>>>>>>> 20208769e528337949e946f526534d61d38bac47
5 changes: 5 additions & 0 deletions 1-js/02-first-steps/15-function-basics/4-pow/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ function pow(x, n) {
return result;
}

<<<<<<< HEAD
let x = prompt("x?", "");
let n = prompt("n?", "");
=======
let x = +prompt("x?", '');
let n = +prompt("n?", '');
>>>>>>> 20208769e528337949e946f526534d61d38bac47

if (n < 1) {
alert(`Power ${n} не се поддържа, използвай число над 1`);
Expand Down
17 changes: 17 additions & 0 deletions 1-js/03-code-quality/02-coding-style/1-style-errors/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Може да забележите следното:

```js no-beautify
<<<<<<< HEAD
function pow(x,n) // <- няма разстояние между аргументите
{ // <- фигуративната скоба е на нов ред
let result=1; // <- няма разстояние преди и след знака =
Expand All @@ -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<n;i++) {result*=x;} // <- no spaces
// the contents of { ... } should be on a new line
return result;
}

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
{ // <- 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`);
>>>>>>> 20208769e528337949e946f526534d61d38bac47
}
else // <- може да се напише на един ред като "} else {"
{
Expand Down
10 changes: 10 additions & 0 deletions 1-js/04-object-basics/01-object/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
>>>>>>> 20208769e528337949e946f526534d61d38bac47

![](object.svg)

Expand All @@ -19,7 +25,11 @@ let user = {}; // синстаксиса "литерал на обект"

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

<<<<<<< HEAD
Обикновено се използват фигурните скоби `{...}`. Тази деклерация се нарича *литерал на обект*.
=======
Usually, the curly braces `{...}` are used. That declaration is called an *object literal*.
>>>>>>> 20208769e528337949e946f526534d61d38bac47

## Литерали и свойства

Expand Down
2 changes: 1 addition & 1 deletion 1-js/05-data-types/04-array/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]`.

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
12 changes: 6 additions & 6 deletions 2-ui/99-ui-misc/01-mutation-observer/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ Such snippet in an HTML markup looks like this:
...
```

For better readability and at the same time, to beautify it, we'll be using a JavaScript syntax highlighting library on our site, like [Prism.js](https://prismjs.com/). To get syntax highlighting for above snippet in Prism, `Prism.highlightElem(pre)` is called, which examines the contents of such `pre` elements and adds special tags and styles for colored syntax highlighting into those elements, similar to what you see in examples here, on this page.
For better readability and at the same time, to beautify it, we'll be using a JavaScript syntax highlighting library on our site, like [Prism.js](https://prismjs.com/). To get syntax highlighting for above snippet in Prism, `Prism.highlightElement(pre)` is called, which examines the contents of such `pre` elements and adds special tags and styles for colored syntax highlighting into those elements, similar to what you see in examples here, on this page.

When exactly should we run that highlighting method? Well, we can do it on `DOMContentLoaded` event, or put the script at the bottom of the page. The moment our DOM is ready, we can search for elements `pre[class*="language"]` and call `Prism.highlightElem` on them:
When exactly should we run that highlighting method? Well, we can do it on `DOMContentLoaded` event, or put the script at the bottom of the page. The moment our DOM is ready, we can search for elements `pre[class*="language"]` and call `Prism.highlightElement` on them:

```js
// highlight all code snippets on the page
document.querySelectorAll('pre[class*="language"]').forEach(Prism.highlightElem);
document.querySelectorAll('pre[class*="language"]').forEach(elem => Prism.highlightElement(elem));
```

Everything's simple so far, right? We find code snippets in HTML and highlight them.
Expand All @@ -146,9 +146,9 @@ let article = /* fetch new content from server */
articleElem.innerHTML = article;
```

The new `article` HTML may contain code snippets. We need to call `Prism.highlightElem` on them, otherwise they won't get highlighted.
The new `article` HTML may contain code snippets. We need to call `Prism.highlightElement` on them, otherwise they won't get highlighted.

**Where and when to call `Prism.highlightElem` for a dynamically loaded article?**
**Where and when to call `Prism.highlightElement` for a dynamically loaded article?**

We could append that call to the code that loads an article, like this:

Expand All @@ -158,7 +158,7 @@ articleElem.innerHTML = article;

*!*
let snippets = articleElem.querySelectorAll('pre[class*="language-"]');
snippets.forEach(Prism.highlightElem);
snippets.forEach(elem => Prism.highlightElement(elem));
*/!*
```

Expand Down