From 62acc7da51152bc9cd3a5324c5081ff26e2798a7 Mon Sep 17 00:00:00 2001 From: Yofri Date: Tue, 20 Jun 2017 04:19:52 +0700 Subject: [PATCH 1/7] another typo --- 1-js/04-object-basics/02-garbage-collection/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/04-object-basics/02-garbage-collection/article.md b/1-js/04-object-basics/02-garbage-collection/article.md index 6f4c832f..913e1e8c 100644 --- a/1-js/04-object-basics/02-garbage-collection/article.md +++ b/1-js/04-object-basics/02-garbage-collection/article.md @@ -23,7 +23,7 @@ Simply put, "reachable" values are those that are accessible or useable somehow. These values are called *roots*. -2. Any other value is considered reachable if it's reachable from a root by a reference of by a chain of references. +2. Any other value is considered reachable if it's reachable from a root by a reference or by a chain of references. For instance, if there's an object in a local variable, and that object has a property referencing another object, that object is considered reachable. And those that it references -- are also reachable. Detailed examples to follow. From 84936782b5d650756c248d553b94b70f333ae5df Mon Sep 17 00:00:00 2001 From: Yofri Date: Tue, 20 Jun 2017 16:03:48 +0700 Subject: [PATCH 2/7] typo --- 1-js/04-object-basics/02-garbage-collection/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/04-object-basics/02-garbage-collection/article.md b/1-js/04-object-basics/02-garbage-collection/article.md index 913e1e8c..571d9f11 100644 --- a/1-js/04-object-basics/02-garbage-collection/article.md +++ b/1-js/04-object-basics/02-garbage-collection/article.md @@ -175,7 +175,7 @@ Then their references are marked: ![](garbage-collection-3.png) -...And their refences, while possible: +...And their references, while possible: ![](garbage-collection-4.png) From 7da4376fdadf1ca7e3d31813ac869f97a33d6660 Mon Sep 17 00:00:00 2001 From: Yofri Date: Mon, 26 Jun 2017 09:14:19 +0700 Subject: [PATCH 3/7] typo --- 1-js/05-data-types/02-number/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/02-number/article.md b/1-js/05-data-types/02-number/article.md index ff07c661..0f08860d 100644 --- a/1-js/05-data-types/02-number/article.md +++ b/1-js/05-data-types/02-number/article.md @@ -362,7 +362,7 @@ alert( parseFloat('12.3.4') ); // 12.3, the second point stops the reading Of course, there are situations when `parseInt/parseFloat` return `NaN`. It happens when no digits could be read: ```js run -alert( parseInt('a123') ); // NaN, the first symbol stops he process +alert( parseInt('a123') ); // NaN, the first symbol stops the process ``` ````smart header="The second argument of `parseInt(str, radix)`" From d2691263ce18f547c752085e96acaa1596159cf2 Mon Sep 17 00:00:00 2001 From: Yofri Date: Mon, 26 Jun 2017 20:42:44 +0700 Subject: [PATCH 4/7] typo --- 1-js/05-data-types/04-array/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/04-array/article.md b/1-js/05-data-types/04-array/article.md index bd7a64e6..3a015601 100644 --- a/1-js/05-data-types/04-array/article.md +++ b/1-js/05-data-types/04-array/article.md @@ -421,7 +421,7 @@ alert( [1] + 1 ); // "11" alert( [1,2] + 1 ); // "1,21" ``` -Arrays do not have `Symbol.toPrimitive`, neither a viable `valueOf`, they implement only `toString` conversion, so here `[]` becomes an empty string, `[1]` becomes `"1"` and `[1,2]` becomes `"1,2". +Arrays do not have `Symbol.toPrimitive`, neither a viable `valueOf`, they implement only `toString` conversion, so here `[]` becomes an empty string, `[1]` becomes `"1"` and `[1,2]` becomes `"1,2"`. When the binary plus `"+"` operator adds something to a string, it converts it to a string as well, so the next step looks like this: From 15d0e14b87dae90e6511a0693abd2b9fa19824cd Mon Sep 17 00:00:00 2001 From: Yofri Date: Tue, 27 Jun 2017 21:31:13 +0700 Subject: [PATCH 5/7] typo --- 1-js/05-data-types/05-array-methods/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/05-array-methods/article.md b/1-js/05-data-types/05-array-methods/article.md index 11905ba4..d836a12d 100644 --- a/1-js/05-data-types/05-array-methods/article.md +++ b/1-js/05-data-types/05-array-methods/article.md @@ -100,7 +100,7 @@ alert( arr ); // "I", "study", "complex", "language", "JavaScript" ``` ````smart header="Negative indexes allowed" -Here and in other array methods, negative indexes are allowed. The specify the position from the end of the array, like here: +Here and in other array methods, negative indexes are allowed. They specify the position from the end of the array, like here: ```js run let arr = [1, 2, 5] From 2908fe7fe65b1035be52e81859ad0de510795121 Mon Sep 17 00:00:00 2001 From: Yofri Date: Tue, 27 Jun 2017 21:40:52 +0700 Subject: [PATCH 6/7] typo --- 1-js/05-data-types/05-array-methods/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/05-array-methods/article.md b/1-js/05-data-types/05-array-methods/article.md index d836a12d..dc847ffc 100644 --- a/1-js/05-data-types/05-array-methods/article.md +++ b/1-js/05-data-types/05-array-methods/article.md @@ -229,7 +229,7 @@ alert( arr.includes(1) ); // true Note that the methods use `===` comparison. So, if we look for `false`, it finds exactly `false` and not the zero. -If we wan to check for inclusion, and don't want to know the exact index, then `arr.includes` is preferred. +If we want to check for inclusion, and don't want to know the exact index, then `arr.includes` is preferred. ### find and findIndex From ab7cd2d14eb58d818548b1ee5448749af7abe245 Mon Sep 17 00:00:00 2001 From: Yofri Date: Tue, 27 Jun 2017 22:02:23 +0700 Subject: [PATCH 7/7] typo --- 1-js/05-data-types/05-array-methods/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/05-array-methods/article.md b/1-js/05-data-types/05-array-methods/article.md index dc847ffc..c8b31123 100644 --- a/1-js/05-data-types/05-array-methods/article.md +++ b/1-js/05-data-types/05-array-methods/article.md @@ -382,7 +382,7 @@ alert(arr); // *!*1, 2, 15*/!* Now it works as intended. -Let's step aside and thing what's happening. The `arr` can be array of anything, right? It may contain numbers or strings or html elements or whatever. We have a set of *something*. To sort it, we need an *ordering function* that knows how to compare its elements. The default is a string order. +Let's step aside and think what's happening. The `arr` can be array of anything, right? It may contain numbers or strings or html elements or whatever. We have a set of *something*. To sort it, we need an *ordering function* that knows how to compare its elements. The default is a string order. The `arr.sort(fn)` method has a built-in implementation of sorting algorithm. We don't need to care how it exactly works (an optimized [quicksort](https://en.wikipedia.org/wiki/Quicksort) most of the time). It will walk the array, compare its elements using the provided function and reorder them, all we need is to provide the `fn` which does the comparison.