You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
411
411
412
412
Like this?
413
413
@@ -502,14 +502,14 @@ In the code above, the whole arguments object is `{}` by default, so there's alw
502
502
let {prop : varName = default, ...} = object
503
503
```
504
504
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.
506
506
507
507
- The array syntax:
508
508
509
509
```js
510
510
let [item1 = default, item2, ...rest] = array
511
511
```
512
512
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`.
514
514
515
515
- For more complex cases, the left side must have the same structure as the right one.
0 commit comments