Skip to content

Commit 9242bc1

Browse files
committed
1.2.5. Article - String
1 parent 95c34ad commit 9242bc1

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

1-js/02-first-steps/05-types/article.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,47 +84,47 @@ Hal-hazırda `BigInt` Firefox və Chrome-da dəstəklənir, lakin Safari, IE və
8484

8585
## String
8686

87-
A string in JavaScript must be surrounded by quotes.
87+
JavaScript-də bir [`string`](https://en.wikipedia.org/wiki/String_(computer_science)) mütləq dırnaqlar ilə əhatə olunmalıdır.
8888

8989
```js
90-
let str = "Hello";
91-
let str2 = 'Single quotes are ok too';
92-
let phrase = `can embed another ${str}`;
90+
let str = "Salam";
91+
let str2 = 'Tək dırnaqlar da uyğundur';
92+
let phrase = `başqa bir ${str} ehtiva edə bilər`;
9393
```
9494

95-
In JavaScript, there are 3 types of quotes.
95+
JavaScript-`string`-i ifadə etməyin 3 yolu mövcuddur.
9696

97-
1. Double quotes: `"Hello"`.
98-
2. Single quotes: `'Hello'`.
99-
3. Backticks: <code>&#96;Hello&#96;</code>.
97+
1. Cüt dırnaq: `"Hello"`.
98+
2. Tək dırnaq: `'Hello'`.
99+
3. Tərs dırnaq: <code>&#96;Salam&#96;</code>.
100100

101-
Double and single quotes are "simple" quotes. There's practically no difference between them in JavaScript.
101+
Cüt dırnaq və tək dırnaqlar "sadə" dırnaqlar adlanır. JavaScript-də onların arasında demək olar ki, heç bir fərq yoxdur.
102102

103-
Backticks are "extended functionality" quotes. They allow us to embed variables and expressions into a string by wrapping them in `${…}`, for example:
103+
Tərs dırnaqlar "genişləndirilmiş funksionallıq" təklif edən dırnaqlardır. Onlar bizə dəyişənləri və ifadələri `${...}` arasına alaraq bir `string`-ə daxil etməyə imkan verir, məsələn:
104104

105105
```js run
106-
let name = "John";
106+
let name = "Eldar";
107107
108-
// embed a variable
109-
alert( `Hello, *!*${name}*/!*!` ); // Hello, John!
108+
// bir dəyişən daxil edin
109+
alert( `Salam, *!*${name}*/!*!` ); // Salam, Eldar!
110110

111-
// embed an expression
112-
alert( `the result is *!*${1 + 2}*/!*` ); // the result is 3
111+
// bir ifadə daxil edin
112+
alert( `nəticə: *!*${1 + 2}*/!*` ); // nəticə: 3
113113
```
114114
115-
The expression inside `${}` is evaluated and the result becomes a part of the string. We can put anything in there: a variable like `name` or an arithmetical expression like `1 + 2` or something more complex.
115+
`${...}` arasındakı ifadə JavaScript mühərriki tərəfindən dəyərləndirilir və nəticə `string`-in bir hissəsinə çevrilir. Biz burada istənilən şeyi yaza bilərik: məsələn, `name` adlı bir dəyişən, `1 + 2` kimi riyazi bir ifadə və ya daha kompleks bir şey.
116116
117-
Please note that this can only be done in backticks. Other quotes don't have this embedding functionality!
117+
Qeyd edək ki, bu yanlız tərs dırnaqlar (backtricks: ``) üçün keçərlidir. Digər dırnaqlarda bu funksionallıq mövcud deyil.
118118
```js run
119-
alert( "the result is ${1 + 2}" ); // the result is ${1 + 2} (double quotes do nothing)
119+
alert( "nəticə: ${1 + 2}" ); // nəticə: ${1 + 2} (cüt dırnaqlar heç nə etmir)
120120
```
121121
122-
We'll cover strings more thoroughly in the chapter <info:string>.
122+
Biz `string`-ləri <info:string> fəslində daha ətraflı izah edəcəyik.
123123
124-
```smart header="There is no *character* type."
125-
In some languages, there is a special "character" type for a single character. For example, in the C language and in Java it is called "char".
124+
```smart header="*character* tipi mövcud deyil."
125+
Bəzi proqramlaşdırma dillərində yalnız bir simvolu saxlamaq üçün xüsusi bir verilənlər tipi mövcuddur. Məsələn, CJava dillərində bu tip "char" adlanır.
126126

127-
In JavaScript, there is no such type. There's only one type: `string`. A string may consist of only one character or many of them.
127+
JavaScript-də belə bir tip yoxdur. Yalnız bir verilən tipi var: `string`. Bir `string` bir və ya daha çox simvoldan ibarət ola bilər.
128128
```
129129
130130
## Boolean (logical type)

0 commit comments

Comments
 (0)