Skip to content

Instantly share code, notes, and snippets.

@davestewart
Created March 22, 2012 13:37
Show Gist options
  • Save davestewart/2158378 to your computer and use it in GitHub Desktop.
Save davestewart/2158378 to your computer and use it in GitHub Desktop.
Multi-line nested ternary operators
var uri = folder instanceof URI
? folder.uri
: folder instanceof Folder
? folder.uri
: typeof folder === 'string'
? URI.toURI(folder, 1)
:null;
if(uri)
{
// do something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment