From 8efbf1f730d5f429d24272e92998214385b3f238 Mon Sep 17 00:00:00 2001 From: Zander Otavka Date: Mon, 9 Jan 2017 13:46:30 -0800 Subject: [PATCH] style(base): Use default param syntax in constructor The constructor of component was using a check for undefined to specify a default value instead of the new ES2015 syntax. Using the new syntax is clearer and more concise, since it shows the parameter is optional right where it is declared. --- packages/mdc-base/component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mdc-base/component.js b/packages/mdc-base/component.js index 6643b941051..f63c4d91771 100644 --- a/packages/mdc-base/component.js +++ b/packages/mdc-base/component.js @@ -25,10 +25,10 @@ export default class MDCComponent { return new MDCComponent(root, new MDCFoundation()); } - constructor(root, foundation, ...args) { + constructor(root, foundation = this.getDefaultFoundation(), ...args) { this.root_ = root; this.initialize(...args); - this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation; + this.foundation_ = foundation; this.foundation_.init(); this.initialSyncWithDOM(); }