August 03, 2017

Use default arguments instead of conditionals

Bad

functioncreateMicrobrewery(name) {
  constbreweryName= name ||'Hipster Brew Co.';
  // ...
}

Good

functioncreateMicrobrewery(breweryName='Hipster Brew Co.') {
  // ...
}