diff --git a/1-js/02-first-steps/14-function-basics/4-pow/solution.md b/1-js/02-first-steps/14-function-basics/4-pow/solution.md index 79eb2b44..5ef20c38 100644 --- a/1-js/02-first-steps/14-function-basics/4-pow/solution.md +++ b/1-js/02-first-steps/14-function-basics/4-pow/solution.md @@ -13,7 +13,7 @@ function pow(x, n) { let x = prompt("x?", ''); let n = prompt("n?", ''); -if (n <= 1) { +if (n < 1) { alert(`Power ${n} is not supported, use an integer greater than 0`); } else { diff --git a/1-js/02-first-steps/14-function-basics/4-pow/task.md b/1-js/02-first-steps/14-function-basics/4-pow/task.md index e4f885a5..f569320c 100644 --- a/1-js/02-first-steps/14-function-basics/4-pow/task.md +++ b/1-js/02-first-steps/14-function-basics/4-pow/task.md @@ -9,7 +9,7 @@ Write a function `pow(x,n)` that returns `x` in power `n`. Or, in other words, m ```js pow(3, 2) = 3 * 3 = 9 pow(3, 3) = 3 * 3 * 3 = 27 -pow(1, 100) = 1 * 1 * ...*1 = 1 +pow(1, 100) = 1 * 1 * ...* 1 = 1 ``` Create a web-page that prompts for `x` and `n`, and then shows the result of `pow(x,n)`. diff --git a/1-js/05-data-types/03-string/3-truncate/_js.view/test.js b/1-js/05-data-types/03-string/3-truncate/_js.view/test.js index c252f16b..99149233 100644 --- a/1-js/05-data-types/03-string/3-truncate/_js.view/test.js +++ b/1-js/05-data-types/03-string/3-truncate/_js.view/test.js @@ -1,5 +1,5 @@ describe("truncate", function() { - it("truncate the long string to the given lenth (including the ellipsis)", function() { + it("truncate the long string to the given length (including the ellipsis)", function() { assert.equal( truncate("What I'd like to tell on this topic is:", 20), "What I'd like to te…" @@ -13,4 +13,4 @@ describe("truncate", function() { ); }); -}); \ No newline at end of file +}); diff --git a/1-js/05-data-types/10-date/3-weekday/task.md b/1-js/05-data-types/10-date/3-weekday/task.md index c2ae2168..ba62790c 100644 --- a/1-js/05-data-types/10-date/3-weekday/task.md +++ b/1-js/05-data-types/10-date/3-weekday/task.md @@ -4,7 +4,7 @@ importance: 5 # European weekday -European countries have days of week starting with monday (number 1), then tuesday (number 2) and till sunday (number 7). Write a function `getLocalDay(date)` that returns the "european" day of week for `date`. +European countries have days of week starting with Monday (number 1), then Tuesday (number 2) and till Sunday (number 7). Write a function `getLocalDay(date)` that returns the "European" day of week for `date`. ```js no-beautify let date = new Date(2012, 0, 3); // 3 Jan 2012 diff --git a/1-js/05-data-types/11-json/article.md b/1-js/05-data-types/11-json/article.md index a23bf583..174b2b7f 100644 --- a/1-js/05-data-types/11-json/article.md +++ b/1-js/05-data-types/11-json/article.md @@ -131,7 +131,7 @@ let meetup = { title: "Conference", *!* room: { - number: 123, + number: 23, participants: ["john", "ann"] } */!* diff --git a/1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md b/1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md index f1c099a3..c2ca8168 100644 --- a/1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md +++ b/1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md @@ -135,7 +135,7 @@ alert( Math.max(3, 5, 1) ); // 5 Now let's say we have an array `[3, 5, 1]`. How do we call `Math.max` with it? -Passing it "as it" won't work, because `Math.max` expects a list of numeric arguments, not a single array: +Passing it "as is" won't work, because `Math.max` expects a list of numeric arguments, not a single array: ```js run let arr = [3, 5, 1]; @@ -145,7 +145,7 @@ alert( Math.max(arr) ); // NaN */!* ``` -And surely we can't manually list items in the code `Math.max(arg[0], arg[1], arg[2])`, because we may be unsure how many there are. As our script executes, there could be a lot, or there could be none. And that would get ugly. +And surely we can't manually list items in the code `Math.max(arr[0], arr[1], arr[2])`, because we may be unsure how many there are. As our script executes, there could be a lot, or there could be none. And that would get ugly. *Spread operator* to the rescue! It looks similar to rest parameters, also using `...`, but does quite the opposite. diff --git a/2-ui/1-document/03-dom-navigation/article.md b/2-ui/1-document/03-dom-navigation/article.md index ab26d4c7..976e595a 100644 --- a/2-ui/1-document/03-dom-navigation/article.md +++ b/2-ui/1-document/03-dom-navigation/article.md @@ -7,9 +7,9 @@ libs: # Walking the DOM -DOM allows to do anything with elements and their contents, but first we need to reach the corresponding DOM object, get it into a variable, and then we are able to modify it. +The DOM allows to do anything with elements and their contents, but first we need to reach the corresponding DOM object, get it into a variable, and then we are able to modify it. -All operations on DOM start with the `document` object. From it we can access any node. +All operations on the DOM start with the `document` object. From it we can access any node. Here's a picture of links that allow to travel between DOM nodes: @@ -273,7 +273,7 @@ Certain types of DOM elements may provide additional properties, specific to the Tables are a great example and important particular case of that. -**``** element supports (in addition to the given above) these properties: +**The `
`** element supports (in addition to the given above) these properties: - `table.rows` -- the collection of `` elements of the table. - `table.caption/tHead/tFoot` -- references to elements ``, ``. - `table.tBodies` -- the collection of `` elements (can be many according to the standard). @@ -283,8 +283,8 @@ Tables are a great example and important particular case of that. **``:** - `tr.cells` -- the collection of ``. -- `tr.sectionRowIndex` -- the number of the given `` inside the enclosing `/`. -- `tr.rowIndex` -- the number of the `` in the table. +- `tr.sectionRowIndex` -- the position (index) of the given `` inside the enclosing `//`. +- `tr.rowIndex` -- the number of the `` in the table as a whole (including all table rows). **``. diff --git a/2-ui/1-document/11-coordinates/article.md b/2-ui/1-document/11-coordinates/article.md index 919db9f4..35ba15e1 100644 --- a/2-ui/1-document/11-coordinates/article.md +++ b/2-ui/1-document/11-coordinates/article.md @@ -55,7 +55,7 @@ If we compare window coordinates versus CSS positioning, then there are obvious But in CSS the `right` property means the distance from the right edge, and the `bottom` -- from the bottom edge. -If we just look at the picture below, we can see that in JavaScript it is not so. All window coordinates are counted from the upper-left corner, including these ones. +If we just look at the picture above, we can see that in JavaScript it is not so. All window coordinates are counted from the upper-left corner, including these ones. ``` ## elementFromPoint(x, y) [#elementFromPoint] diff --git a/2-ui/2-events/03-event-delegation/article.md b/2-ui/2-events/03-event-delegation/article.md index 16d9dc71..83b4b6ce 100644 --- a/2-ui/2-events/03-event-delegation/article.md +++ b/2-ui/2-events/03-event-delegation/article.md @@ -1,7 +1,7 @@ # Event delegation -Capturing and bubbling allow to implement one of most powerful event handling patterns called *event delegation*. +Capturing and bubbling allow us to implement one of most powerful event handling patterns called *event delegation*. The idea is that if we have a lot of elements handled in a similar way, then instead of assigning a handler to each of them -- we put a single handler on their common ancestor. diff --git a/6-async/03-promise-chaining/02-error-async/task.md b/6-async/03-promise-chaining/02-error-async/task.md index f3fdf62b..bafc47ce 100644 --- a/6-async/03-promise-chaining/02-error-async/task.md +++ b/6-async/03-promise-chaining/02-error-async/task.md @@ -1,6 +1,6 @@ # Error in setTimeout -How do you think, does the `.catch` trigger? Explain your answer? +What do you think? Will the `.catch` trigger? Explain your answer. ```js new Promise(function(resolve, reject) {
`, `
` and `` cells inside the given `
` and ``:** - `td.cellIndex` -- the number of the cell inside the enclosing `