Skip to content

Commit f341dde

Browse files
author
Maksim Litvinov
committed
add example
1 parent 9032b3f commit f341dde

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

modules/30-variables/13-variables-naming/description.en.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ theory: |
1717
1818
A common joke among developers is that "the hardest part of programming is cache invalidation and naming things". Coming up with names is tough indeed. How would you name a variable that stores _the number of unpaid orders from customers in debt from the previous quarter?_
1919
20+
```javascript
21+
const firstName = 'John';
22+
console.log(firstName); // => John
23+
24+
const playerNumber = 24;
25+
console.log(playerNumber); // => 24
26+
```
27+
2028
Self-сheck. Think of a name for the variable that would store _"the number of siblings the king has"_. Write it down in a notebook or send it to yourself. Don't put anything in there except the name of the variable. And we'll come back to this topic in a few lessons ;-)
2129
2230
instructions: |

modules/30-variables/13-variables-naming/description.ru.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ theory: |
1919
2020
Среди разработчиков есть шутка: «самое сложное в программировании — названия переменных и инвалидация кеша». Придумывать названия и правда сложно. Как бы вы назвали переменную, в которой хранится _количество неоплаченных заказов от клиентов, имеющих задолженность в предыдущем квартале?_
2121
22+
В JavaScript в именах констант и переменных каждое слово пишется с заглавной буквы, кроме первого. Например:
23+
24+
```javascript
25+
const firstName = 'John';
26+
console.log(firstName); // => John
27+
28+
const playerNumber = 24;
29+
console.log(playerNumber); // => 24
30+
```
31+
2232
Самопроверка. Придумайте название для переменной, в которой будет храниться _«количество братьев и сестёр короля»_. Запишите его в блокноте или отправьте себе на почту. Не указывайте там ничего, кроме названия переменной. А через несколько уроков мы вернёмся к этой теме ;-)
2333
2434
instructions: |

0 commit comments

Comments
 (0)