Skip to content

Commit db39a8b

Browse files
committed
up
1 parent 15019c1 commit db39a8b

3 files changed

Lines changed: 27 additions & 8 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# if (строка с нулём)
1+
# if (a string with zero)
22

33
[importance 5]
44

5-
Выведется ли `alert`?
5+
Will `alert` be shown?
66

77
```js
88
if ("0") {
9-
alert( 'Привет' );
9+
alert( 'Hello' );
1010
}
1111
```
1212

1-js/2-first-steps/12-ifelse/2-check-standard/ifelse_task2/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
<body>
55
<script>
6-
var value = prompt('Каково "официальное" название JavaScript?', '');
6+
var value = prompt('What is the "official" name of JavaScript?', '');
77

88
if (value == 'EcmaScript') {
9-
alert('Верно!');
9+
alert('Right!');
1010
} else {
11-
alert('Не знаете? "EcmaScript"!');
11+
alert("Didn't know? EcmaScript!");
1212
}
1313
</script>
1414

1-js/2-first-steps/7-types-intro/article.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,35 @@ We'll cover working with numbers in the chapter [](/number).
4343
```js
4444
var str = "Hello";
4545
var str2 = 'Single quotes are ok too';
46-
var prase = `can embed ${str}`;
46+
var phrase = `can embed ${str}`;
4747
```
4848

4949
In JavaScript, there are 3 types of quotes.
5050

5151
<ol>
52-
<li>Double quotes and single quotes are essentially the same.</li>
52+
<li>Double quotes: `"Hello"`.</li>
53+
<li>Single quotes: `'Hello'`.</li>
5354
<li>Backtricks are "extended functionality" quotes. They allow to embed other variables or even expressions into the string wrapping them by `${…}`.</li>
5455
</ol>
5556

57+
Double and single quotes are essentially the same. The only difference between them can be seen when the string includes the quotation character `"` or `'`.
58+
59+
A double quote symbol may appear inside single-quoted lines and vise versa:
60+
61+
```js
62+
var hello = "I'm JavaScript"; // single-quote inside "…"
63+
var name = 'My "official" name is "EcmaScript"'; // vise versa
64+
```
65+
66+
If we want to include a single quote inside a same-quoted string, we can do it too. But we need to prepend it with a slash:
67+
68+
```js
69+
// prepend ' inside the string with a slash \'
70+
var hello = 'I\'m JavaScript';
71+
```
72+
73+
Similarly with double quotes.
74+
5675
[smart header="There is no *character* type."]
5776
In some languages, there is a special "character" type for a single character. For example, in the C language it is `char`.
5877

0 commit comments

Comments
 (0)