Skip to content

Commit 3c02d21

Browse files
authored
Merge pull request #234 from javascript-tutorial/sync-4541b7af
Sync with upstream @ 4541b7a
2 parents 56a9e45 + ff227c1 commit 3c02d21

File tree

34 files changed

+82
-63
lines changed

34 files changed

+82
-63
lines changed

1-js/02-first-steps/01-hello-world/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Os arquivos de script são anexados ao HTML com o atributo `src`:
7373
<script src="/path/to/script.js"></script>
7474
```
7575

76-
Aqui, `/path/to/script.js` é um caminho absoluto para o arquivo script (da raiz do site). Você também pode fornecer um caminho relativo a partir da página atual. Por exemplo, `src="script.js"` significaria um arquivo `"script.js"` na pasta atual.
76+
Aqui, `/path/to/script.js` é um caminho absoluto para o arquivo (script) da raiz do site. Você também pode fornecer um caminho relativo a partir da página atual. Por exemplo, `src="script.js"`, tal como `src="./script.js"`, significaria um arquivo `"script.js"` na pasta atual.
7777

7878
Nós também podemos dar uma URL completa. Por exemplo:
7979

1-js/05-data-types/03-string/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Here's the full list:
8181
| Character | Description |
8282
|-----------|-------------|
8383
|`\n`|New line|
84-
|`\r`|Carriage return: not used alone. Windows text files use a combination of two characters `\r\n` to represent a line break. |
84+
|`\r`|In Windows text files a combination of two characters `\r\n` represents a new break, while on non-Windows OS it's just `\n`. That's for historical reasons, most Windows software also understands `\n`. |
8585
|`\'`, `\"`|Quotes|
8686
|`\\`|Backslash|
8787
|`\t`|Tab|

1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("byField", function(){
2323
{ name: "John", age: 20, surname: "Johnson"},
2424
];
2525
let ageSortedAnswer = users.sort(byField("age"));
26-
assert.deepEqual(ageSortedKey, ageSortedKey);
26+
assert.deepEqual(ageSortedKey, ageSortedAnswer);
2727
});
2828

2929
it("sorts users by surname", function(){

1-js/06-advanced-functions/10-bind/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ let user = {
187187

188188
let say = user.say.bind(user);
189189

190-
say("Hello"); // Hello, John ("Hello" argument is passed to say)
191-
say("Bye"); // Bye, John ("Bye" is passed to say)
190+
say("Hello"); // Hello, John! ("Hello" argument is passed to say)
191+
say("Bye"); // Bye, John! ("Bye" is passed to say)
192192
```
193193

194194
````smart header="Convenience method: `bindAll`"

1-js/09-classes/06-instanceof/article.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ The algorithm of `obj instanceof Class` works roughly as follows:
8686
*!*
8787
alert(rabbit instanceof Animal); // true
8888
*/!*
89+
8990
// rabbit.__proto__ === Rabbit.prototype
91+
*!*
9092
// rabbit.__proto__.__proto__ === Animal.prototype (match!)
93+
*/!*
9194
```
9295

9396
Here's the illustration of what `rabbit instanceof Animal` compares with `Animal.prototype`:

1-js/11-async/02-promise-basics/03-animate-circle-promise/solution.view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
text-align: center;
1111
}
1212
.circle {
13-
transition-property: width, height, margin-left, margin-top;
13+
transition-property: width, height;
1414
transition-duration: 2s;
1515
position: fixed;
1616
transform: translateX(-50%) translateY(-50%);

1-js/11-async/08-async-await/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The `async` keyword before a function has two effects:
303303
304304
The `await` keyword before a promise makes JavaScript wait until that promise settles, and then:
305305
306-
1. If it's an error, the exception is generated — same as if `throw error` were called at that very place.
306+
1. If it's an error, an exception is generated — same as if `throw error` were called at that very place.
307307
2. Otherwise, it returns the result.
308308
309309
Together they provide a great framework to write asynchronous code that is easy to both read and write.

1-js/13-modules/01-modules-intro/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ In a module, top-level `this` is undefined, as opposed to a global object in non
261261
262262
There are also several browser-specific differences of scripts with `type="module"` compared to regular ones.
263263
264-
You may want skip those for now if you're reading for the first time, or if you don't use JavaScript in a browser.
264+
You may want to skip this section for now if you're reading for the first time, or if you don't use JavaScript in a browser.
265265
266266
### Module scripts are deferred
267267

2-ui/1-document/05-basic-dom-node-properties/article.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ The classes are:
2424
- [HTMLElement](https://html.spec.whatwg.org/multipage/dom.html#htmlelement) -- is finally the basic class for all HTML elements. It is inherited by concrete HTML elements:
2525
- [HTMLInputElement](https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement) -- the class for `<input>` elements,
2626
- [HTMLBodyElement](https://html.spec.whatwg.org/multipage/semantics.html#htmlbodyelement) -- the class for `<body>` elements,
27-
- [HTMLAnchorElement](https://html.spec.whatwg.org/multipage/semantics.html#htmlanchorelement) -- the class for `<a>` elements
28-
- ...and so on, each tag has its own class that may provide specific properties and methods.
27+
- [HTMLAnchorElement](https://html.spec.whatwg.org/multipage/semantics.html#htmlanchorelement) -- the class for `<a>` elements,
28+
- ...and so on.
29+
30+
There are many other tags with their own classes that may specific properties and methods, while some elements, such as `<span>`, `<section>`, `<article>` do not have any specific properties, so they are instances of `HTMLElement` class.
2931

3032
So, the full set of properties and methods of a given node comes as the result of the inheritance.
3133

@@ -130,7 +132,7 @@ For instance:
130132
131133
```html run
132134
<body>
133-
<script>
135+
<script>
134136
let elem = document.body;
135137
136138
// let's examine what it is?

2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.view/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
function clockStart() {
4646
// set a new interval only if the clock is stopped
4747
// otherwise we would rewrite the timerID reference to the running interval and wouldn't be able to stop the clock ever again
48-
if (!timerId) {
48+
if (!timerId) {
4949
timerId = setInterval(update, 1000);
5050
}
5151
update(); // <-- start right now, don't wait 1 second till the first setInterval works
@@ -56,7 +56,6 @@
5656
timerId = null; // <-- clear timerID to indicate that the clock has been stopped, so that it is possible to start it again in clockStart()
5757
}
5858

59-
clockStart();
6059
</script>
6160

6261
<!-- click on this button calls clockStart() -->

0 commit comments

Comments
 (0)