Skip to content

Instantly share code, notes, and snippets.

@JoaoCnh
Last active July 10, 2017 19:54
Show Gist options
  • Save JoaoCnh/fa6d4315a41575c98b6be06eee164b2a to your computer and use it in GitHub Desktop.
Save JoaoCnh/fa6d4315a41575c98b6be06eee164b2a to your computer and use it in GitHub Desktop.
bad refactoring
const dataIsEmpty = data.length === 0;
const valueCeil = Math.ceil(data.someValue);
const valueCeilIsValid = helperClass.isValid(valueCeil);
dataIsEmpty && valueCeilIsValid ? runFunctionA(data) : runFunctionB(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment