File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -476,19 +476,22 @@ createMenu(menuConfig);
476476** Good** :
477477``` javascript
478478var menuConfig = {
479- title: null ,
480- body : ' Bar ' ,
481- buttonText: null ,
479+ title: ' Order ' ,
480+ // User did not include 'body' key
481+ buttonText: ' Send ' ,
482482 cancellable: true
483483}
484484
485485function createMenu (config ) {
486- Object .assign (config , {
486+ config = Object .assign ({} , {
487487 title: ' Foo' ,
488488 body: ' Bar' ,
489489 buttonText: ' Baz' ,
490490 cancellable: true
491- });
491+ }, config);
492+
493+ // config now equals: {title: "Order", body: "Bar", buttonText: "Send", cancellable: true}
494+ // ...
492495}
493496
494497createMenu (menuConfig);
@@ -1204,7 +1207,7 @@ class Square extends Shape {
12041207 setLength (length ) {
12051208 this .length = length;
12061209 }
1207-
1210+
12081211 getArea () {
12091212 return this .length * this .length ;
12101213 }
You can’t perform that action at this time.
0 commit comments