Skip to content

Commit e43e1a0

Browse files
committed
2 parents a69e9e7 + 259f1b9 commit e43e1a0

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

1-js/01-getting-started/1-intro/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# An introduction to JavaScript
1+
# An Introduction to JavaScript
22

33
Let's see what's so special about JavaScript, what we can achieve with it and which other technologies play well with it.
44

1-js/02-first-steps/07-operators/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Funny code, isn't it? We should understand how it works, because sometimes we ca
201201

202202
## Remainder %
203203

204-
The remainder operator `%` despite it's look does not have a relation to percents.
204+
The remainder operator `%` despite its look does not have a relation to percents.
205205

206206
The result of `a % b` is the remainder of the integer division of `a` by `b`.
207207

@@ -415,7 +415,7 @@ let a = (1+2, 3+4);
415415
alert( a ); // 7 (the result of 3+4)
416416
```
417417
418-
Here, the first expression `1+2` is evaluated, and it's result is thrown away, then `3+4` is evaluated and returned as the result.
418+
Here, the first expression `1+2` is evaluated, and its result is thrown away, then `3+4` is evaluated and returned as the result.
419419
420420
```smart header="Comma has a very low precedence"
421421
Please note that the comma operator has very low precedence, lower than `=`, so parentheses are important in the example above.

1-js/02-first-steps/13-switch/article.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,15 @@ switch (arg) {
155155
case '0':
156156
case '1':
157157
alert( 'One or zero' );
158+
break;
158159
159160
case '2':
160161
alert( 'Two' );
161162
break;
162163
163164
case 3:
164165
alert( 'Never executes!' );
165-
166+
break;
166167
default:
167168
alert( 'An unknown value' )
168169
}

1-js/04-object-basics/04-object-methods/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ The result of a property access `user.hi` is not a function, but a value of Refe
316316

317317
When parentheses `()` are called on the Reference Type, they receive the full information about the object and it's method, and can set the right `this` (`=user` in this case).
318318

319-
Any other operation like assignment `hi = user.hi` discards the reference type as a whole, takes the value of `user.hi` (a function) and passes it on. So any further operation "looses" `this`.
319+
Any other operation like assignment `hi = user.hi` discards the reference type as a whole, takes the value of `user.hi` (a function) and passes it on. So any further operation "loses" `this`.
320320

321321
So, as the result, the value of `this` is only passed the right way if the function is called directly using a dot `obj.method()` or square brackets `obj[method]()` syntax (they do the same here).
322322

1-js/04-object-basics/05-object-toprimitive/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Object to primitive conversion
33

4-
What happens when objects are added `obj1 + obj2`, substracted `obj1 - obj2` or printed using `alert(obj)`?
4+
What happens when objects are added `obj1 + obj2`, subtracted `obj1 - obj2` or printed using `alert(obj)`?
55

66
There are special methods in objects that do the conversion.
77

@@ -11,7 +11,7 @@ In the chapter <info:type-conversions> we've seen the rules for numeric, string
1111

1212
For objects, there's no to-boolean conversion, because all objects are `true` in a boolean context. So there are only string and numeric conversions.
1313

14-
The numeric conversion happens when we substract objects or apply mathematical functions. For instance, `Date` objects (to be covered in the chapter <info:date>) can be substracted, and the result of `date1 - date2` is the time difference between two dates.
14+
The numeric conversion happens when we subtract objects or apply mathematical functions. For instance, `Date` objects (to be covered in the chapter <info:date>) can be subtracted, and the result of `date1 - date2` is the time difference between two dates.
1515

1616
As for the string conversion -- it usually happens when we output an object like `alert(obj)` and in similar contexts.
1717

1-js/04-object-basics/06-constructor-new/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,16 @@ alert( new SmallUser().name ); // John
162162

163163
Usually constructors don't have a `return` statement. Here we mention the special behavior with returning objects mainly for the sake of completeness.
164164

165-
````smart header="Omitting brackets"
166-
By the way, we can omit brackets after `new`, if it has no arguments:
165+
````smart header="Omitting parentheses"
166+
By the way, we can omit parentheses after `new`, if it has no arguments:
167167
168168
```js
169-
let user = new User; // <-- no brackets
169+
let user = new User; // <-- no parentheses
170170
// same as
171171
let user = new User();
172172
```
173173
174-
Omitting brackets here is not considered a "good style", but the syntax is permitted by specification.
174+
Omitting parentheses here is not considered a "good style", but the syntax is permitted by specification.
175175
````
176176

177177
## Methods in constructor

1-js/05-data-types/04-array/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Objects allow to store keyed collections of values. That's fine.
44

55
But quite often we find that we need an *ordered collection*, where we have a 1st, a 2nd, a 3rd element and so on. For example, we need that to store a list of something: users, goods, HTML elements etc.
66

7-
It not convenient to use an object here, because it provides no methods to manage the order of elements. We can’t insert a new property “between” the existing ones. Objects are just not meant for such use.
7+
It is not convenient to use an object here, because it provides no methods to manage the order of elements. We can’t insert a new property “between” the existing ones. Objects are just not meant for such use.
88

99
There exists a special data structure named `Array`, to store ordered collections.
1010

0 commit comments

Comments
 (0)