File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -476,19 +476,22 @@ createMenu(menuConfig);
476
476
** Good** :
477
477
``` javascript
478
478
var menuConfig = {
479
- title: null ,
480
- body : ' Bar ' ,
481
- buttonText: null ,
479
+ title: ' Order ' ,
480
+ // User did not include 'body' key
481
+ buttonText: ' Send ' ,
482
482
cancellable: true
483
483
}
484
484
485
485
function createMenu (config ) {
486
- Object .assign (config , {
486
+ config = Object .assign ({} , {
487
487
title: ' Foo' ,
488
488
body: ' Bar' ,
489
489
buttonText: ' Baz' ,
490
490
cancellable: true
491
- });
491
+ }, config);
492
+
493
+ // config now equals: {title: "Order", body: "Bar", buttonText: "Send", cancellable: true}
494
+ // ...
492
495
}
493
496
494
497
createMenu (menuConfig);
@@ -1204,7 +1207,7 @@ class Square extends Shape {
1204
1207
setLength (length ) {
1205
1208
this .length = length;
1206
1209
}
1207
-
1210
+
1208
1211
getArea () {
1209
1212
return this .length * this .length ;
1210
1213
}
You can’t perform that action at this time.
0 commit comments