Skip to content

Instantly share code, notes, and snippets.

@user24
Created November 27, 2011 22:59
Show Gist options
  • Save user24/1398373 to your computer and use it in GitHub Desktop.
Save user24/1398373 to your computer and use it in GitHub Desktop.
var hasMultipleArgs = args.length > 1;
var argIsString = typeof arg == 'string';
var argIsSentence = ~arg.indexOf(' ');
var argIsFormattingOption = ~arg.indexOf('%');
if (hasMultipleArgs && argIsString && !argIsSentence && !argIsFormattingOption) { /*...*/ }
// see https://github.com/observing/devnull/blob/master/lib/logger.js#L364-367 for alternative style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment