File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -251,11 +251,12 @@ destructuring syntax. This has a few advantages:
251251
2522521 . When someone looks at the function signature, it's immediately clear what
253253 properties are being used.
254- 2 . Destructuring also clones the specified primitive values of the argument
254+ 2 . It can be used to simulate named parameters.
255+ 3 . Destructuring also clones the specified primitive values of the argument
255256 object passed into the function. This can help prevent side effects. Note:
256257 objects and arrays that are destructured from the argument object are NOT
257258 cloned.
258- 3 . Linters can warn you about unused properties, which would be impossible
259+ 4 . Linters can warn you about unused properties, which would be impossible
259260 without destructuring.
260261
261262** Bad:**
@@ -264,6 +265,9 @@ destructuring syntax. This has a few advantages:
264265function createMenu (title , body , buttonText , cancellable ) {
265266 // ...
266267}
268+
269+ createMenu (" Foo" , " Bar" , " Baz" , true );
270+
267271```
268272
269273** Good:**
You can’t perform that action at this time.
0 commit comments