Skip to content

Instantly share code, notes, and snippets.

@joneff
Created June 22, 2011 13:54
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 joneff/1040129 to your computer and use it in GitHub Desktop.
Save joneff/1040129 to your computer and use it in GitHub Desktop.
js shorthands
var flag = !!document.something.testFeature
// e.g.
var canvasIsSupported = !!document.createElement("canvas").getContext
// if short hand
canvasIsSuppoted && doSomething()
// means
if (canvasIsSupported)
doSomething
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment