-
Notifications
You must be signed in to change notification settings - Fork 12
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
Translate Variables page #7
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
In the code below, each line corresponds to the item in the task list. | ||
Aşağıdakı kodda olan hər sətir tapşıqıda olan hər maddəyə aiddir. | ||
|
||
```js run | ||
let admin, name; // can declare two variables at once | ||
let admin, name; // eyni zamanda iki dəyişən yaratmaq mümkündür | ||
|
||
name = "John"; | ||
name = "Orxan"; | ||
|
||
admin = name; | ||
|
||
alert( admin ); // "John" | ||
alert( admin ); // "Orxan" | ||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
## The variable for our planet | ||
## Bizim planetimizin dəyişəni | ||
|
||
That's simple: | ||
Bu asandır: | ||
|
||
```js | ||
let ourPlanetName = "Earth"; | ||
let ourPlanetName = "Yer"; | ||
``` | ||
|
||
Note, we could use a shorter name `planet`, but it might be not obvious what planet it refers to. It's nice to be more verbose. At least until the variable isNotTooLong. | ||
Nəzərə alın ki, biz `planet` adından istifadə edə bilərdik. Lakin, bu ad ilə hansı planetdən danışdığımız bilinməyəcəkdi. Daha məlumatlı adlar yazmaq yaxşıdır. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. danışdığımız "bilinməyəcəkdir." (the word should end with r) |
||
|
||
## The name of the current visitor | ||
## Cari ziyarətçinin adı | ||
|
||
```js | ||
let currentUserName = "John"; | ||
let currentUserName = "Orxan"; | ||
``` | ||
|
||
Again, we could shorten that to `userName` if we know for sure that the user is current. | ||
Biz bu dəyişənin həmişə cari istifadəçi haqqında olduğunu bilsəydik bu dəyişəni `userName` adlandıra bilərdik. | ||
|
||
Modern editors and autocomplete make long variable names easy to write. Don't save on them. A name with 3 words in it is fine. | ||
Modern redaktorlarda olan avtomatik tamamlayıcı qurğular ilə uzun adları yazmaq asanlaşır. Üç sözdən ibarət ad normaldır. | ||
|
||
And if your editor does not have proper autocompletion, get [a new one](/code-editors). | ||
Əgər redaktorununzda avtomatik tamamlayıcı qurğu yoxdursa, [yeni redaktor əldə edin](/code-editors). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please correct the typo |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ importance: 3 | |
|
||
--- | ||
|
||
# Giving the right name | ||
# Düzgün adın verilməsi | ||
|
||
1. Create a variable with the name of our planet. How would you name such a variable? | ||
2. Create a variable to store the name of a current visitor to a website. How would you name that variable? | ||
1. Bizim planetimizin adında dəyişən yaradın. Bu dəyişəni necə adlandırardınız? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Bizim planetimiz" is better |
||
2. Veb səhifəyə daxil olan cari ziyarətçinin adını dəyişəndə saxlayın. Bu dəyişəni necə adlandırardınız? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
We generally use upper case for constants that are "hard-coded". Or, in other words, when the value is known prior to execution and directly written into the code. | ||
Normalda, biz əl ilə yazılan sabit dəyişənləri böyük hərf ilə yazırıq. Digər sözlə, dəyişənin dəyəri skriptin icrasından öncə bilindikdə və kodda birbaşa yazıldıqda biz bu dəyişəni böyük hərf ilə yazırıq. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Digər sözlə, dəyişənin (there is no comma) |
||
|
||
In this code, `birthday` is exactly like that. So we could use the upper case for it. | ||
Bu kodda, `birthday` dəyişəninin bu formada olduğundan biz böyük hərfdən istifadə edə bilərik. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No comma |
||
|
||
In contrast, `age` is evaluated in run-time. Today we have one age, a year after we'll have another one. It is constant in a sense that it does not change through the code execution. But it is a bit "less of a constant" than `birthday`: it is calculated, so we should keep the lower case for it. | ||
Lakin, `age` dəyişəni icra zamanı hesablanır. Bugün bizdə bir yaş, bir il sonra isə fərqli yaş olacaq. Bu dəyişən kod icrası zamanı dəyişmir amma bu dəyişən hesablanır deyə `birthday`-dən daha "az sabitdir". Bu səbəbdən, bu dəyişənin adı böyük hərf ilə yazılmamalıdır. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lakin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"tapşıqda" olan hər (there is a typo)