Skip to content

Commit a20ea9c

Browse files
Merge pull request #11 from danwit/master
Fixed typos
2 parents 530fd61 + ae5255b commit a20ea9c

11 files changed

+24
-24
lines changed

ebook/01_var_let_const.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ let j = "I am a let";
125125
`var` can be accessed **before** they are defined, but we can't access their **value**.
126126
`let` and `const` can't be accessed **before we define them**.
127127

128-
Despite what you may read on other sources, both `var` and `let`(and `const`) are subject to **hoisting** which measn thath they are processe before any code is executed and lifted up to the top of their scope (whether it's global or block).
128+
Despite what you may read on other sources, both `var` and `let`(and `const`) are subject to **hoisting** which means that they are processed before any code is executed and lifted up to the top of their scope (whether it's global or block).
129129

130130
The main differences lays in the fact that `var` can still be accessed before they are defined, causing the value to be `undefined` while on the other hand, `let` variables sit in a **temporal dead zone** until they are declared, causing an error when accessed before initialization which makes it easier to debug code rather than having an `undefined` as the result.
131131

ebook/02_arrow_functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const arrowFunction = name => `hello ${name}`;
5656
```
5757

5858
Both functions achieve the same result, but the new syntax allows you to be more concise.
59-
Beware! Readability is more important than conciceness so you might want to write your funciton like this if you are working in a team and not everybody is totally up-to-date with ES6.
59+
Beware! Readability is more important than conciseness so you might want to write your funciton like this if you are working in a team and not everybody is totally up-to-date with ES6.
6060

6161
```js
6262
const arrowFunction = (name) => {
@@ -208,7 +208,7 @@ ReferenceError: arguments is not defined
208208

209209
To access all the arguments passed to the function we can either use the old function notation or the spread syntax(which we will discuss more in Chapter 9)
210210

211-
Remember that `arguments` it's just a keyword, it's not a variable name.
211+
Remember that `arguments` is just a keyword, it's not a variable name.
212212

213213
Example with **arrow function**:
214214

@@ -230,4 +230,4 @@ const showWinner = function() {
230230
}
231231
showWinner("Usain Bolt", "Justin Gatlin", "Asafa Powell")
232232
// "Usain Bolt was the winner"
233-
```
233+
```

ebook/03_default_function_arguments.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ getLocation('Paris','France')
2020
// Europe France Paris
2121
```
2222

23-
As you can see our function taskes three arguments, a city, a country and a continent. In the function body we are checking if either country or continent are `undefined` and in that case we are giving them a **default value**.
23+
As you can see our function takes three arguments, a city, a country and a continent. In the function body we are checking if either country or continent are `undefined` and in that case we are giving them a **default value**.
2424

2525
When calling `getLocation('Milan')` the second and third parameter (country and continent) are undefined and get replaced by the default values of our functions.
2626

@@ -90,7 +90,7 @@ const bill = calculatePrice({ tip: 0.15, total:150 });
9090

9191
We made the argument of our function an Object and when calling the function we don't even have to worry about the order of the parameters because they will be matched based on their key.
9292

93-
In the example above the default value for *tip* was 0.05 and we overrode it with 0.15 but we didn't give a value to tax which remained the default 0.1.
93+
In the example above the default value for *tip* was 0.05 and we overwrote it with 0.15 but we didn't give a value to tax which remained the default 0.1.
9494

9595
Notice this detail:
9696

@@ -120,4 +120,4 @@ calculatePrice(undefined)
120120

121121
No matter what we passed, the argument was defaulted to an `Object` which had three default properties of total, tax and tip.
122122

123-
Don't worry about destructuring, we will talk about it in Chapter 10.
123+
Don't worry about destructuring, we will talk about it in Chapter 10.

ebook/07_iterables-and-looping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ for (const digit of digits) {
117117
// 1 3 5 7 9
118118
```
119119

120-
The last important difference I want to talk is that the `for in` loop will iterate over new properties added to the object.
120+
The last important difference I want to talk about is that the `for in` loop will iterate over new properties added to the object.
121121

122122
```js
123123
const fruit = ["apple","banana", "orange"];

ebook/08_array_improvements.md

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

55
`Array.from()` is the first of the many new array methods that ES6 introduced.
66

7-
It will take something **arrayish**, meaning something that looks like an array but it isn't, and transform it into a real array.
7+
It will take something **arrayish**, meaning something that looks like an array but isn't, and transform it into a real array.
88

99
```html
1010
<div class="fruits">
@@ -128,4 +128,4 @@ console.log(arrayEvery);
128128
// false
129129
```
130130

131-
Simply put, the first condition is true, because there are **some** elements greater than 2, but the second is false because **not every element** is greater than 2.
131+
Simply put, the first condition is true, because there are **some** elements greater than 2, but the second is false because **not every element** is greater than 2.

ebook/10_object_literal_upgrades.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ var name = "myname";
9999
var person = {}
100100
// update the object
101101
person[name] = "Alberto";
102-
console.log(person.name);
102+
console.log(person.myname);
103103
// Alberto
104104
```
105105

@@ -112,6 +112,6 @@ const name = "myname";
112112
const person = {
113113
[name]:"Alberto",
114114
};
115-
console.log(person.name);
115+
console.log(person.myname);
116116
// Alberto
117-
```
117+
```

ebook/12_classes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Ok, now that I refreshed your knowledge of prototypal inheritance, let's have a
3333

3434
## Create a `Class`
3535

36-
There are two way of creating a class:
36+
There are two ways of creating a class:
3737

3838
- class declaration
3939
- class expression
@@ -101,7 +101,7 @@ Person.info();
101101

102102
## `set` and `get`
103103

104-
We use setter and getter methods to set and get values inside our `Class`.
104+
We can use setter and getter methods to set and get values inside our `Class`.
105105

106106
```js
107107
class Person {
@@ -247,4 +247,4 @@ for(const student of myClass) {
247247
// Object { name: "Jim", grade: 8 }
248248
// Object { name: "Jon", grade: 10 }
249249
// Object { name: "Timmy", grade: 7 }
250-
```
250+
```

ebook/13_promises.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ Promise
247247
// first value second value
248248
```
249249

250-
Our values returned together, after 1000ms (the timeout of the *second* promise) meaning that the first one had to wait the completion of the second one.
250+
Our values returned together, after 1000ms (the timeout of the *second* promise) meaning that the first one had to wait for the completion of the second one.
251251

252252
If we were to pass an empty iterable then it will return an already resolved promise.
253253

@@ -274,7 +274,7 @@ Promise
274274
// Error: oooops error
275275
```
276276

277-
`Promise.race()` on the other hand returns a promises that resolves or rejects as soon as one of the promises in the iterable resolves or reject, with the value from that promise.
277+
`Promise.race()` on the other hand returns a promise that resolves or rejects as soon as one of the promises in the iterable resolves or reject, with the value from that promise.
278278

279279
``` js
280280
const promise1 = new Promise((resolve,reject) => {
@@ -291,4 +291,4 @@ Promise.race([promise1, promise2]).then(function(value) {
291291
// expected output: "second value"
292292
```
293293

294-
If we passed an empty iterable, the race would be pending forever!.
294+
If we passed an empty iterable, the race would be pending forever!.

ebook/16_sets_weaksets_maps_weakmaps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ console.log(family);
2828

2929
As you can see, at the end we tried to add "Dad" again,but the `Set` still remained the same because a `Set` can only take **unique values**.
3030

31-
Let's continue using the same `Set` and see what method we can use on it.
31+
Let's continue using the same `Set` and see what methods we can use on it.
3232

3333
``` js
3434
family.size;
@@ -193,4 +193,4 @@ myWeakMap;
193193
// WeakMap {}
194194
```
195195

196-
As you can see *mom* was garbage collected after we set the its value to `null` whilst *dad* still remains inside our `Map`.
196+
As you can see *mom* was garbage collected after we set the its value to `null` whilst *dad* still remains inside our `Map`.

ebook/18_ES2017_string-padding-object-entries-object-values-and-more.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Object.getOwnPropertyDescriptors(myObj);
128128

129129
## Trailing commas in function parameter lists and calls
130130

131-
This is just a minor change to a syntax. Now, when writing objects we can to leave a trailing comma after each parameter, whether or not it is the last one.
131+
This is just a minor change to a syntax. Now, when writing objects we can leave a trailing comma after each parameter, whether or not it is the last one.
132132

133133
``` js
134134
// from this
@@ -178,4 +178,4 @@ Examples of its methods are:
178178

179179
- add / sub
180180
- and / or / xor
181-
- load / store
181+
- load / store

0 commit comments

Comments
 (0)