Skip to content

Instantly share code, notes, and snippets.

@jonpemby
Created March 16, 2018 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonpemby/ef386f9b39c4e75ea5eec789e6e93cf1 to your computer and use it in GitHub Desktop.
Save jonpemby/ef386f9b39c4e75ea5eec789e6e93cf1 to your computer and use it in GitHub Desktop.
JavaScript one liner to determine if multiple strings/arrays are empty
export default (...fields) => [...fields].reduce((sum, { length }) => sum + length, 0) === 0;
@jonpemby
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment