diff --git a/1-js/2-first-steps/8-operators/article.md b/1-js/2-first-steps/8-operators/article.md index 644de0ed..fe35d3dc 100644 --- a/1-js/2-first-steps/8-operators/article.md +++ b/1-js/2-first-steps/8-operators/article.md @@ -118,29 +118,28 @@ Why did unary pluses work before the binary one? As we're going to see soon, tha ## Operators precedence +If an expression has more than one operator -- their execution order is defined the their *precedence*. -В том случае, если в выражении есть несколько операторов -- порядок их выполнения определяется *приоритетом*. +From the school we all know that the multiplication in the expression `1 + 2 * 2` should be calculated before the addition. That's exactly the precedence thing. If we're not satisfied with the order, we can use brackets to override the default precedence: `(1 + 2) * 2`. -Из школы мы знаем, что умножение в выражении `2 * 2 + 1` выполнится раньше сложения, т.к. его *приоритет* выше, а скобки явно задают порядок выполнения. Но в JavaScript -- гораздо больше операторов, поэтому существует целая [таблица приоритетов](https://developer.mozilla.org/en/JavaScript/Reference/operators/operator_precedence). +There are many operators in JavaScript. For clarity and internal needs there exists a [precedence table](https://developer.mozilla.org/en/JavaScript/Reference/operators/operator_precedence). Every operator has a corresponding precedence number. The one with the bigger number executes first. If the precedence is same -- the execution order is from left to right. -Она содержит как уже пройденные операторы, так и те, которые мы еще не проходили. В ней каждому оператору задан числовой приоритет. Тот, у кого число больше -- выполнится раньше. Если приоритет одинаковый, то порядок выполнения -- слева направо. - -Отрывок из таблицы: +An extract from the table:
... | ... | ... |
15 | унарный плюс | `+` |
15 | унарный минус | `-` |
14 | умножение | `*` |
14 | деление | `/` |
13 | сложение | `+` |
13 | вычитание | `-` |
15 | unary plus | `+` |
15 | unary minus | `-` |
14 | multiplication | `*` |
14 | division | `/` |
13 | addition | `+` |
13 | substraction | `-` |
... | ... | ... |
3 | присвоение | `=` |
3 | assignment | `=` |
... | ... | ... |