Skip to content

Commit 5027ceb

Browse files
authored
Merge pull request lydiahallie#9 from ziga-miklic/patch-1
Typos fix
2 parents 5037c6c + 1e811c2 commit 5027ceb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ JavaScript interprets (or unboxes) statements. When we use bracket notation, it
160160

161161
`mouse[bird.size]`: First it evaluates `bird.size`, which is `"small"`. `mouse["small"]` returns `true`
162162

163-
However, with dot notation. this doesn't happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefinfed`, we're actually asking `undefined.size`. This isn't valid, and will throw an error similar to `Cannot read property "size" of undefined`.
163+
However, with dot notation, this doesn't happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefinfed`, we're actually asking `undefined.size`. This isn't valid, and will throw an error similar to `Cannot read property "size" of undefined`.
164164

165165
</p>
166166
</details>
@@ -385,7 +385,7 @@ console.log(sarah);
385385

386386
#### Answer: A
387387

388-
For `sarah`, we didn't use the `new` keyword.When using `new`, it refers to the new empty object we create. However, if you don't add `new` it refers to the **global object**!
388+
For `sarah`, we didn't use the `new` keyword. When using `new`, it refers to the new empty object we create. However, if you don't add `new` it refers to the **global object**!
389389

390390
We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smith"`. What we actually did, is defining `global.firstName = 'Sarah'` and `global.lastName = 'Smith'`. `sarah` itself is left `undefined`.
391391

@@ -415,7 +415,7 @@ During the **capturing** phase, the event goes through the ancestor elements dow
415415

416416
---
417417

418-
###### 13. All object have prototypes.
418+
###### 13. All objects have prototypes.
419419

420420
- A: true
421421
- B: false
@@ -452,7 +452,7 @@ sum(1, "2");
452452

453453
#### Answer: C
454454

455-
JavScript is a **dynamimcally typed language**: we don't specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another.
455+
JavaScript is a **dynamically typed language**: we don't specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another.
456456

457457
In this example, JavaScript converts the number `1` into a string, in order for the function to make sense and return a value. During the addition of a numeric type (`1`) and a string type (`'2'`), the number is treated as a string. We can concatenate strings like `"Hello" + "World"`, so what's happening here is `"1" + "2"` which returns `"12"`.
458458

@@ -584,7 +584,7 @@ getAge(21);
584584

585585
#### Answer: C
586586

587-
The spread operator (`...args`.) retrusn an array with arguments. An array is an object, so `typeof args` returns `"object"`
587+
The spread operator (`...args`.) returns an array with arguments. An array is an object, so `typeof args` returns `"object"`
588588

589589
</p>
590590
</details>
@@ -613,7 +613,7 @@ getAge();
613613

614614
#### Answer: C
615615

616-
With `"use strict"`, you can make sure that you don't accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. It we didn't use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object.
616+
With `"use strict"`, you can make sure that you don't accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn't use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object.
617617

618618
</p>
619619
</details>
@@ -651,7 +651,7 @@ sessionStorage.setItem("cool_secret", 123);
651651

652652
- A: Forever, the data doesn't get lost.
653653
- B: When the user closes the tab.
654-
- C: When the uses closes the entire browser, not only the tab.
654+
- C: When the user closes the entire browser, not only the tab.
655655
- D: When the user shuts off their computer.
656656

657657
<details><summary><b>Answer</b></summary>
@@ -718,7 +718,7 @@ set.has(1);
718718

719719
#### Answer: C
720720

721-
All object keys (excluding Symbols) are strings under the hood, even if you don't type it youself as a string. This is why `obj.hasOwnProperty('1')` also returns true.
721+
All object keys (excluding Symbols) are strings under the hood, even if you don't type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true.
722722

723723
It doesn't work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`.
724724

@@ -884,7 +884,7 @@ We have a `setTimeout` function and invoked it first. Yet, it was logged last.
884884

885885
This is because in browsers, we don't just have the runtime engine, we also have something called a `WebAPI`. The `WebAPI` gives us the `setTimeout` function to start with, and for example the DOM.
886886

887-
After the _callback_ is pushed to the WebAPI,the `setTimeout` function itself (but not the callback!) is popped off the stack.
887+
After the _callback_ is pushed to the WebAPI, the `setTimeout` function itself (but not the callback!) is popped off the stack.
888888

889889
<img src="https://i.imgur.com/X5wsHOg.png" width="200">
890890

@@ -900,7 +900,7 @@ The WebAPI can't just add stuff to the stack whenever it's ready. Instead, it pu
900900

901901
<img src="https://i.imgur.com/NSnDZmU.png" width="200">
902902

903-
This is where an event loop starts to work. An **event loop** looks looks at the stack and task queue. If the stack is empty, it takes the first thing on the queue and pushes it onto the stack.
903+
This is where an event loop starts to work. An **event loop** looks at the stack and task queue. If the stack is empty, it takes the first thing on the queue and pushes it onto the stack.
904904

905905
<img src="https://i.imgur.com/uyiScAI.png" width="200">
906906

0 commit comments

Comments
 (0)