Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo in en #764

Merged
merged 3 commits into from
Jul 11, 2024
Merged
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
4 changes: 2 additions & 2 deletions modules/10-basics/45-testing/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ One of your tasks in the following lessons will be to write a function that perf
"ello, World!"
</pre>

In addition to our tests, it's very useful to experiment with code in the [browser console](https://developer.mozilla.org/en-US/docs/Tools/Browser_Console). When something isn't clear to you or you want to experiment with code, feel free to do all of this in the console. Ideally, it's best to execute all the code given in the lessons on your own. In addition to the console, you can also use [repl.it](https://repl.it/languages/javascript).
In addition to our tests, it's very useful to experiment with code in the [browser console](https://developer.mozilla.org/en-US/docs/Tools/Browser_Console). When something isn't clear to you, or you want to experiment with code, feel free to do all of this in the console. Ideally, it's best to execute all the code given in the lessons on your own. In addition to the console, you can also use [repl.it](https://repl.it/languages/javascript).

Sometimes when creating a solution, it may seem that you have done everything correctly, but the system has got into a huff and won't accept your solution. Such cases are borderline impossible. Failed tests simply won't get as far as the site, they are automatically run after each change. In the vast majority of cases (all our projects have been run millions of times in total over many years) the error is in the solution code. It can be very imperceptible, maybe you used the wrong punctuation, or you used upper case instead of lower case, or you missed a comma. Other cases are more complicated. Maybe your solution works for one set of inputs, but not for another. So always read the instructions and test your output carefully. There will almost certainly be some sign of an error.

However, if you are sure about a mistake or have found an inaccuracy, you can always point it out. At the end of each theory section, there is a link to the contents of the lesson on Github (this project is completely open-source!). You can write about an issue, look through the tests (you can see how your code is called there), and even send a pull request. If it's all gone over your head, then join the #hexlet-feedback channel in [Slack community](https://slack.hexlet.io/), where we'll always be ready to help you.
However, if you are sure about a mistake or have found an inaccuracy, you can always point it out. At the end of each theory section, there is a link to the contents of the lesson on GitHub (this project is completely open-source!). You can write about an issue, look through the tests (you can see how your code is called there), and even send a pull request. If it's all gone over your head, then join the #hexlet-feedback channel in [Slack community](https://slack.hexlet.io/), where we'll always be ready to help you.
2 changes: 1 addition & 1 deletion modules/10-basics/50-syntax-errors/en/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
If a JavaScript program is syntactically incorrect, the interpreter will show a relevant message and a message showing the file and line where the error might have occurred. **Syntax errors** occur when the code has grammatical mistakes. Grammar is essential to human language, but a text with grammar mistakes can still be read and understood. However, when it comes to programming, things are much more strict. Even a tiny mistake can mean your program won't run. Maybe you've mixed up your brackets, or there's a `;` that you forgot to add — these are just some examples of such mistakes.
If a JavaScript program is syntactically incorrect, the interpreter will show a relevant message and a message showing the file and line where the error might have occurred. **Syntax errors** occur when the code has grammatical mistakes. Grammar is essential to human language, but a text with grammar mistakes can still be read and understood. However, when it comes to programming, things are much stricter. Even a tiny mistake can mean your program won't run. Maybe you've mixed up your brackets, or there's a `;` that you forgot to add — these are just some examples of such mistakes.

Here is an example of some code with a syntax error:

Expand Down
2 changes: 1 addition & 1 deletion modules/20-arithmetics/20-basic/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ After launching, the result will appear on the screen:
7
```

Besides addition, the following operations are available:
The following operations are available besides addition:
`*` — multiplication
`/` — division
`-` — subtraction
Expand Down
2 changes: 1 addition & 1 deletion modules/20-arithmetics/50-float/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ console.log(Number.MAX_SAFE_INTEGER);
9007199254740991
```

Rational numbers are not lined up in a continuous chain like integers, there's an infinite amount of numbers between _0.1_ and _0.2_. So now we have a big problem: how can we store rational numbers? Excellent question. There is a myriad of articles in the internet about memory organization in these cases. Moreover, there is even a standard describing how to do it correctly, and an overwhelming number of languages are based on this set of recommendations.
Rational numbers are not lined up in a continuous chain like integers, there's an infinite amount of numbers between _0.1_ and _0.2_. So now we have a big problem: how can we store rational numbers? Excellent question. There is a myriad of articles on the internet about memory organization in these cases. Moreover, there is even a standard describing how to do it correctly, and an overwhelming number of languages are based on this set of recommendations.

As developers, it's important to understand that operations with floating numbers are not precise (though precision can be adjusted using special tricks).
6 changes: 3 additions & 3 deletions modules/20-arithmetics/80-linting/en/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Since we've learned to write simple programs, let's talk about the very process of writing.

The program code should be organized in a certain way so that it is sufficiently clear and easy to maintain. Special sets of rules - standards - describe different aspects of code writing. The most common standard in JavaScript is [AirBnb](https://github.com/airbnb/javascript).
The program code should be organized in a certain way so that it is sufficiently clear and easy to maintain. Special sets of rules - standards - describe different aspects of code writing. The most common standard in JavaScript is [Airbnb](https://github.com/airbnb/javascript).

In any programming language, there are utilities known as **linters**. They ensure the code meets the standards. For example, [ESLint](https://eslint.org/) analyzes JavaScript code.

Expand All @@ -15,7 +15,7 @@ Linter won't be happy about it, because several rules have been violated:
* [space-infix-ops](https://eslint.org/docs/rules/space-infix-ops) – No space between operator and operands
* [no-mixed-operators](https://eslint.org/docs/rules/no-mixed-operators) – You can't write code that contains multiple operations in a single expression with no explicit parentheses separation

In the last lesson we recognized that such an abundance of numbers and symbols may be confusing and we decided to add parentheses purely for the sake of readability:
In the last lesson we recognized that such an abundance of numbers and symbols may be confusing, and we decided to add parentheses purely for the sake of readability:

```javascript
console.log(((8 / 2) + 5) - (-3 / 2)); // => 10.5
Expand All @@ -35,4 +35,4 @@ Unfortunately, yes. This time, the `*` and `/` are in the same expression and th

[no-mixed-operators](https://eslint.org/docs/rules/no-mixed-operators) is just one of many rules. Other ones describe indentations, entity names, parentheses, mathematical operations, line length, and many other aspects. Each rule may seem small and insignificant, but together they form the basis of good code.

CodeBasics won't test your code with a linter now, but in your future Hexlet practice segments and in actual development, the linter will work and flag the bugs.
Code-Basics won't test your code with a linter now, but in your future Hexlet practice segments and in actual development, the linter will work and flag the bugs.
6 changes: 3 additions & 3 deletions modules/25-strings/15-escape-characters/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ The result:
'\n\n'.length; // 2 !!!
```

Why is it done in this way? `\n` is just a way to write a line break symbol. That's why line feed is just one character, just invisible. And it's also why this problem has arisen. There had to be a way of representing it using a keyboard. And since the number of keyboard characters is limited and they're all dedicated to very important things, special characters are entered using these escape sequences.
Why is it done in this way? `\n` is just a way to write a line break symbol. That's why line feed is just one character, just invisible. And it's also why this problem has arisen. There had to be a way of representing it using a keyboard. And since the number of keyboard characters is limited, and they're all dedicated to very important things, special characters are entered using these escape sequences.

The Line Feed symbol is not something specific to programming. Anyone who has ever typed on a computer has used the line feed by clicking Enter. Many editors can display these invisible characters, you can use this feature to see where they are (though it's only for display, these characters are invisible, they've no graphical representation):
The Line Feed symbol is not something specific to programming. Anyone who has ever typed on a computer has used the line feed by clicking Enter. Many editors can display these invisible characters, you can use this feature to see where they are (though it's only for display, these characters are invisible, they have no graphical representation):

<pre class='hexlet-basics-output'>
- Hi!¶
Expand Down Expand Up @@ -124,4 +124,4 @@ The result:
Joffrey loves using \n
</pre>

A small but important note about Windows. Windows uses `\r\n` by default to enter a line break. This combination works well in Windows but creates problems when copied to other systems (for example, when the development team includes both Windows and Linux users). The point is that the sequence `\r\n` has a different interpretation depending on the encoding chosen (we discuss it later). For this reason, it's common among developers to always use `\n` without `\r`, since it means that LF is always interpreted the same way and works fine on any system. Remember to configure your editor to use `\n`.
A small but important note about Windows. Windows uses `\r\n` by default to enter a line break. This combination works well on Windows but creates problems when copied to other systems (for example, when the development team includes both Windows and Linux users). The point is that the sequence `\r\n` has a different interpretation depending on the encoding chosen (we discuss it later). For this reason, it's common among developers to always use `\n` without `\r`, since it means that LF is always interpreted the same way and works fine on any system. Remember to configure your editor to use `\n`.
2 changes: 1 addition & 1 deletion modules/25-strings/30-encoding/en/EXERCISE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ console.log(String.fromCharCode(63));

Character 63 will be printed - a question mark. You can print any character this way.

Find an ASCII table on the internet. You can use queries like "ascii codes table" or "ascii codes". Generally, these tables give codes in several number systems: decimal, binary, octal and hexadecimal. We are interested in the decimal code (*dec* or *decimal*).
Find an ASCII table on the internet. You can use queries like "ASCII codes table" or "ASCII codes". Generally, these tables give codes in several number systems: decimal, binary, octal and hexadecimal. We are interested in the decimal code (*dec* or *decimal*).

Using the example above and the table you found, print the characters `~`, `^` and `%` (each on their own line).

Expand Down
2 changes: 1 addition & 1 deletion modules/25-strings/30-encoding/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Different encodings have different numbers of characters. At first, small tables

With the development of computers, different countries needed their own comprehensive tables. Including Cyrillic letters, hieroglyphs, Arabic script, additional mathematical and typographic characters, and even emojis as time went on.

One [Unicode standarts](https://en.wikipedia.org/wiki/Unicode) standard in particular, *utf-8*, is the one used in most cases today. It includes characters from almost all of the written languages found in the world. Therefore, a letter written by someone from China in Chinese can easily be opened and read natively on a computer in Finland (whether the reader would understand it or not is another question).
One [Unicode standards](https://en.wikipedia.org/wiki/Unicode) standard in particular, *utf-8*, is the one used in most cases today. It includes characters from almost all the written languages found in the world. Therefore, a letter written by someone from China in Chinese can easily be opened and read natively on a computer in Finland (whether the reader would understand it or not is another question).

Programmers have to deal with encodings regularly. Unicode support in different programming languages is carried out on a different level. Moreover, encodings must be declared when working with databases and files.
4 changes: 2 additions & 2 deletions modules/30-variables/15-variables-expressions/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Write a program that takes the initial amount of euros stored in the variable `eurosCount`, converts euros to dollars, and prints it. Then, it should convert the result to yuans and print it on a new line.
Write a program that takes the initial amount of euros stored in the variable `eurosCount`, converts euros to dollars, and prints it. Then, it should convert the result to yuan and print it on a new line.

Sample output for 100 euros:

Expand All @@ -10,4 +10,4 @@ Sample output for 100 euros:

Suppose that:
- 1 euro = 1.25 dollars
- 1 dollar = 6.91 yuans
- 1 dollar = 6.91 yuan
18 changes: 9 additions & 9 deletions modules/30-variables/15-variables-expressions/en/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Variables are helpful not only for storing and reusing data but also for simplifying complex calculations. Consider an example: you need to convert euros into yuans through dollars. Banks often do this kind of conversion via an intermediate currency when shopping abroad.
Variables are helpful not only for storing and reusing data but also for simplifying complex calculations. Consider an example: you need to convert euros into yuan through dollars. Banks often do this kind of conversion via an intermediate currency when shopping abroad.

First, convert 50 euros into dollars. Suppose that one euro is $1.25:

Expand Down Expand Up @@ -34,28 +34,28 @@ console.log(who);

Run it on [repl.it](https://repl.it/languages/javascript) and experiment a little with it.

Now, back to our currency program. We'll record the dollar value in yuans as a separate variable. Calculate the value of 50 euros in dollars by multiplying them by `1.25`. Suppose that 1 dollar is 6.91 yuans:
Now, back to our currency program. We'll record the dollar value in yuan as a separate variable. Calculate the value of 50 euros in dollars by multiplying them by `1.25`. Suppose that 1 dollar is 6.91 yuan:

```javascript
let yuansPerDollar = 6.91;
let yuanPerDollar = 6.91;
let dollarsCount = 50 * 1.25; // 62.5
let yuansCount = dollarsCount * yuansPerDollar; // 431.875
let yuanCount = dollarsCount * yuanPerDollar; // 431.875

console.log(yuansCount);
console.log(yuanCount);
```

Now, let's merge our output with some text via concatenation:

```javascript
let yuansPerDollar = 6.91;
let yuanPerDollar = 6.91;
let dollarsCount = 50 * 1.25; // 62.5
let yuansCount = dollarsCount * yuansPerDollar; // 431.875
let yuanCount = dollarsCount * yuanPerDollar; // 431.875

console.log('The price is ' + yuansCount + ' yuans');
console.log('The price is ' + yuanCount + ' yuan');
```

<pre class='hexlet-basics-output'>
The price is 431.875 yuans
The price is 431.875 yuan
</pre>

Any variable can be part of any expression. During the computation, the variable's name is replaced with its value.
Expand Down
2 changes: 1 addition & 1 deletion modules/30-variables/15-variables-expressions/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let dollarsCount = 50 * 1.25;
console.log(dollarsCount); // => 62.5
```

В предыдущем уроке мы записывали в переменную конкретное значение. А здесь `let dollarsCount = 50 * 1.25;` справа от знака равно находится **выражение**. Интерпретатор вычислит результат — `62.5` — и запишет его в переменную. С точки зрения интерпретатора не важно, что перед ним: `62.5` или `50 * 1.25`, для него оба варианта — выражения, которые надо вычислить. И они вычисляются в одно и тоже значение — `62.5`.
В предыдущем уроке мы записывали в переменную конкретное значение. А здесь `let dollarsCount = 50 * 1.25;` справа от знака равно находится **выражение**. Интерпретатор вычислит результат — `62.5` — и запишет его в переменную. С точки зрения интерпретатора не важно, что перед ним: `62.5` или `50 * 1.25`, для него оба варианта — выражения, которые надо вычислить. И они вычисляются в одно и то же значение — `62.5`.

Любая строка — выражение. Конкатенация строк — тоже выражение. Когда интерпретатор видит выражение, он обрабатывает его и генерирует результат — **значение выражения**. Вот несколько примеров выражений, а в комментариях справа от каждого выражения — итоговое значение:

Expand Down
2 changes: 1 addition & 1 deletion modules/30-variables/23-constants/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const pi = 3.14;
pi = 5; // TypeError: Assignment to constant variable.
```

You may be wondering why we need it. Can't we just use variables? Even if we limit ourselves to variables, it won't change the fact that they will often play the role of constants. Moreover, it is possible to write JavaScript code idiomatically without using variables at all. Take a look at the example from [the actual Hexlet code](https://github.com/Hexlet/hexlet-exercise-kit/blob/main/import-documentation/index.js). You're unlikely to understand it at this stage, but try counting the number of constants and variables there are, you'll see that there's exactly one variable and a whole bunch of constants.
You may be wondering why we need it. Can't we just use variables? Even if we limit ourselves to variables, it won't change the fact that they will often play the role of constants. Moreover, it is possible to write JavaScript code idiomatically without using variables at all. Take a look at the example from [the actual Hexlet code](https://github.com/Hexlet/hexlet-exercise-kit/blob/main/import-documentation/index.js). You're unlikely to understand it at this stage, but try counting the number of constants and variables there are, you'll see that there's exactly one variable and a bunch of constants.

Constants make it a lot easier to analyze; when we encounter a constant, it's obvious right away that its value always stays the same. With constants, we don't need to worry about when they were written. With variables, however, we can't be certain of their value and have to analyze all the code to figure out how they may have changed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const sum = 1 + 5;
console.log(1 + 5);
```

But not any code can be an expression. The definition of a variable is a statement, it can't be part of an expression and it will lead to an error:
But not any code can be an expression. The definition of a variable is a statement, it can't be part of an expression, and it will lead to an error:

```javascript
// Pointless code that won't work
Expand Down
Loading
Loading