Skip to content

Commit c57ae29

Browse files
committed
started translation of 'JavaScript Specials'
1 parent 7e83dc7 commit c57ae29

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

  • 1-js/02-first-steps/16-javascript-specials

1-js/02-first-steps/16-javascript-specials/article.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
# JavaScript specials
1+
# Особливості JavaScript
22

3-
This chapter briefly recaps the features of JavaScript that we've learned by now, paying special attention to subtle moments.
3+
Давайте коротко повторимо вивчений матеріал і пригадаємо ключові моменти.
44

5-
## Code structure
5+
## Структура коду
66

7-
Statements are delimited with a semicolon:
7+
Інструкції розділяються крапкою з комою:
88

99
```js run no-beautify
10-
alert('Hello'); alert('World');
10+
alert('Привіт'); alert('Світ');
1111
```
1212

13-
Usually, a line-break is also treated as a delimiter, so that would also work:
13+
Зазвичай, перенесення рядка також вважається за розділювач, тому такий варіант теж працюватиме:
1414

1515
```js run no-beautify
16-
alert('Hello')
17-
alert('World')
16+
alert('Привіт')
17+
alert('Світ')
1818
```
1919

20-
That's called "automatic semicolon insertion". Sometimes it doesn't work, for instance:
20+
Це називається "автоматичне вставлення крапки з комою". Іноді такий варіант може не спрацювати, наприклад:
2121

2222
```js run
23-
alert("There will be an error after this message")
23+
alert("Після цього повідомлення буде помилка")
2424

2525
[1, 2].forEach(alert)
2626
```
2727

28-
Most codestyle guides agree that we should put a semicolon after each statement.
28+
Більшість посібників по стилю коду рекомендують ставити крапку з комою після кожної інструкції.
2929

30-
Semicolons are not required after code blocks `{...}` and syntax constructs with them like loops:
30+
Крапку з комою не потрібно ставити після блоків коду `{...}` та синтаксичних конструкцій з ними, наприклад, після циклів:
3131

3232
```js
3333
function f() {
34-
// no semicolon needed after function declaration
34+
// після оголошення функції не обов'язково ставити крапку з комою
3535
}
3636

3737
for(;;) {
38-
// no semicolon needed after the loop
38+
// після циклу також немає потреби ставити крапку з комою
3939
}
4040
```
4141

42-
...But even if we can put an "extra" semicolon somewhere, that's not an error. It will be ignored.
42+
...Але навіть якщо ми поставимо "зайву" крапку з комою, помилки не буде. Її просто буде проігноровано.
4343

44-
More in: <info:structure>.
44+
Детальніше: <info:structure>.
4545

4646
## Strict mode
4747

0 commit comments

Comments
 (0)