Skip to content

Commit 6b4fc72

Browse files
authored
Merge pull request #601 from gratiaa/patch-5
[PR] Fix minor typos
2 parents fea2209 + fdcda8b commit 6b4fc72

File tree

1 file changed

+5
-5
lines changed
  • 1-js/05-data-types/09-destructuring-assignment

1 file changed

+5
-5
lines changed

1-js/05-data-types/09-destructuring-assignment/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ It looks great when combined with `split` or other array-returning methods:
3131
let [firstName, surname] = "Ilya Kantor".split(' ');
3232
```
3333

34-
````smart header="\"Destructuring\" does not mean \"destructive\""
35-
It's called "destructuring assignment", because it "destructurizes" by copying items into variables. But the array itself is not modified.
34+
````smart header="\"Destructuring\" does not mean \"destructive\"."
35+
It's called "destructuring assignment," because it "destructurizes" by copying items into variables. But the array itself is not modified.
3636
3737
It's just a shorter way to write:
3838
```js
@@ -407,7 +407,7 @@ function showMenu(title = "Untitled", width = 200, height = 100, items = []) {
407407
}
408408
```
409409
410-
In real-life the problem is how to remember the order of arguments. Usually IDEs try to help us, especially if the code is well-documented, but still... Another problem is how to call a function when most parameters are ok by default.
410+
In real-life, the problem is how to remember the order of arguments. Usually IDEs try to help us, especially if the code is well-documented, but still... Another problem is how to call a function when most parameters are ok by default.
411411
412412
Like this?
413413
@@ -502,14 +502,14 @@ In the code above, the whole arguments object is `{}` by default, so there's alw
502502
let {prop : varName = default, ...} = object
503503
```
504504

505-
This means that property `prop` should go into the variable `varName` and, if no such property exists, then `default` value should be used.
505+
This means that property `prop` should go into the variable `varName` and, if no such property exists, then the `default` value should be used.
506506

507507
- The array syntax:
508508

509509
```js
510510
let [item1 = default, item2, ...rest] = array
511511
```
512512

513-
The first item goes to `item1`, the second goes into `item2`, all the rest makes the array `rest`.
513+
The first item goes to `item1`; the second goes into `item2`, all the rest makes the array `rest`.
514514

515515
- For more complex cases, the left side must have the same structure as the right one.

0 commit comments

Comments
 (0)