Skip to content

Commit bc9117e

Browse files
committed
minor
1 parent e76364d commit bc9117e

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

1-js/03-code-quality/01-debugging-chrome/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ For example, here `1+2` results in `3`, and `hello("debugger")` returns nothing,
4646

4747
## Breakpoints
4848

49-
Let's examine what's going on within the code. In `hello.js`, click at the line number `4`. Yes, right on the `"4"` digit, not on the code.
49+
Let's examine what's going on within the code of the [example page](debugging/index.html). In `hello.js`, click at the line number `4`. Yes, right on the `"4"` digit, not on the code.
5050

5151
Contratulations! You've set a breakpoint. Please also click on the number for line `8`.
5252

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ let user = {
157157
let admin = user;
158158
user = null; // overwrite to make things obvious
159159

160-
admin.sayHi(); // wops! inside sayHi(), the old name is used! error!
160+
admin.sayHi(); // Woops! inside sayHi(), the old name is used! error!
161161
```
162162

163163
If we used `this.name` instead of `user.name` inside the `alert`, then the code would work.

1-js/05-data-types/07-map-set-weakmap-weakset/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ let obj = {};
287287
weakMap.set(obj, "ok"); // works fine (object key)
288288
289289
*!*
290-
weakMap.set("test", "wops"); // Error, because "test" is a primitive
290+
weakMap.set("test", "Woops"); // Error, because "test" is a primitive
291291
*/!*
292292
```
293293

1-js/05-data-types/11-json/article.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ alert(user); // {name: "John", age: 30}
2323

2424
...But in the process of development, new properties are added, old properties are renamed and removed. Updating such `toString` every time can become a pain. We could try to loop over properties in it, but what is the object is complex and has nested objects in properties? We'd need to implement their conversion as well. And, if we're sending the object over a network, then we also need to supply the code to "read" our object on the receiving side.
2525

26-
Luckily, there's no need to write the code to handle all this. The task has been solved already.
26+
Luckily, there's no need to write the code to handle all this. The task has been solved already.
2727

2828
[cut]
2929

3030
## JSON.stringify
3131

3232
The [JSON](http://en.wikipedia.org/wiki/JSON) (JavaScript Object Notation) is a general format to represent values and objects. It is described as in [RFC 4627](http://tools.ietf.org/html/rfc4627) standard. Initially it was made for JavaScript, but many other languages have libraries to handle it as well. So it's easy to use JSON for data exchange when the client uses JavaScript and the server is written on Ruby/PHP/Java/Whatever.
3333

34-
JavaScript provides methods:
34+
JavaScript provides methods:
3535

3636
- `JSON.stringify` to convert objects into JSON.
3737
- `JSON.parse` to convert JSON back into an object.
@@ -477,7 +477,7 @@ alert( meetup.date.getDate() ); // Error!
477477
*/!*
478478
```
479479

480-
Wops! An error!
480+
Woops! An error!
481481

482482
The value of `meetup.date` is a string, not a `Date` object. How `JSON.parse` may know that it should transform that string into a `Date`?
483483

1-js/06-advanced-functions/09-call-apply-decorators/article.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ JavaScript gives exceptional flexibility when dealing with functions. They can b
88

99
Let's say we have a function `slow(x)` which is CPU-heavy, but its results are stable. In other words, for the same `x` it always returns the same result.
1010

11-
If the function is called often, we may want to cache (remember) the results for different `x` to evade spending extra-time on recalculations.
11+
If the function is called often, we may want to cache (remember) the results for different `x` to evade spending extra-time on recalculations.
1212

1313
But instead of adding that functionality into `slow()` we'll create a wrapper. As we'll see, there are many benefits of doing so.
1414

@@ -106,7 +106,7 @@ alert( worker.slow(1) ); // the original method works
106106
worker.slow = cachingDecorator(worker.slow); // now make it caching
107107

108108
*!*
109-
alert( worker.slow(2) ); // WOPS! Error: Cannot read property 'someMethod' of undefined
109+
alert( worker.slow(2) ); // WOOPS! Error: Cannot read property 'someMethod' of undefined
110110
*/!*
111111
```
112112

@@ -241,7 +241,7 @@ There are many solutions possible:
241241

242242
1. Implement a new (or use a third-party) map-like data structure that is more versatile and allows multi-keys.
243243
2. Use nested maps: `cache.set(min)` will be a `Map` that stores the pair `(max, result)`. So we can get `result` as `cache.get(min).get(max)`.
244-
3. Join two values into one. In our particular case we can just use a string `"min,max"` as the `Map` key. For flexibility, we can allow to provide a *hashing function* for the decorator, that knows how to make a one value from many.
244+
3. Join two values into one. In our particular case we can just use a string `"min,max"` as the `Map` key. For flexibility, we can allow to provide a *hashing function* for the decorator, that knows how to make a one value from many.
245245

246246

247247
For many practical applications, the 3rd variant is good enough, so we'll stick to it.

1-js/07-object-oriented-programming/10-class-inheritance/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ The `super` in the arrow function is the same as in `stop()`, so it works as int
154154
155155
```js
156156
// Unexpected super
157-
setTimeout(function() { super.stop() }, 1000);
157+
setTimeout(function() { super.stop() }, 1000);
158158
```
159159
````
160160

@@ -210,7 +210,7 @@ let rabbit = new Rabbit("White Rabbit", 10); // Error: this is not defined.
210210
*/!*
211211
```
212212

213-
Wops! We've got an error. Now we can't create rabbits. What went wrong?
213+
Woops! We've got an error. Now we can't create rabbits. What went wrong?
214214

215215
The short answer is: constructors in inheriting classes must call `super(...)`, and (!) do it before using `this`.
216216

1-js/08-error-handling/1-try-catch/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ For instance:
612612
*/!*
613613

614614
function readData() {
615-
badFunc(); // wops, something went wrong!
615+
badFunc(); // Woops, something went wrong!
616616
}
617617

618618
readData();

1-js/08-error-handling/2-custom-errors/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ class ValidationError extends Error {
4747
}
4848

4949
function test() {
50-
throw new ValidationError("Wops!");
50+
throw new ValidationError("Woops!");
5151
}
5252

5353
try {
5454
test();
5555
} catch(err) {
56-
alert(err.message); // Wops!
56+
alert(err.message); // Woops!
5757
alert(err.name); // ValidationError
5858
alert(err.stack); // a list of nested calls with line numbers for each
5959
}

10-regular-expressions/08-regexp-greedy-and-lazy/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ alert( str.match(reg) ); // <a href="link" class="doc">
218218
let str = '...<a href="link1" class="doc">... <a href="link2" class="doc">...';
219219
let reg = /<a href=".*" class="doc">/g;
220220

221-
// Wops! Two links in one match!
221+
// Woops! Two links in one match!
222222
alert( str.match(reg) ); // <a href="link1" class="doc">... <a href="link2" class="doc">
223223
```
224224

figures.sketch

48 KB
Binary file not shown.

0 commit comments

Comments
 (0)