Skip to content

Instantly share code, notes, and snippets.

@yugarinn
Created October 1, 2019 06:27
Show Gist options
  • Select an option

  • Save yugarinn/d9324c7e66ed7f093a000b4237b06b68 to your computer and use it in GitHub Desktop.

Select an option

Save yugarinn/d9324c7e66ed7f093a000b4237b06b68 to your computer and use it in GitHub Desktop.
ternary operator
// NO?
validator.isValid()
? (this.status = Statuses.Valid)
: (this.status = Statuses.Invalid);
// YES?
this.status = validator.isValid()
? Statuses.Valid
: Statuses.Invalid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment