Skip to content

Instantly share code, notes, and snippets.

@jrmoran
Created December 9, 2011 03:48
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 jrmoran/1450065 to your computer and use it in GitHub Desktop.
Save jrmoran/1450065 to your computer and use it in GitHub Desktop.
Weird JS
p = console.log;
// # objects are truthy
var b = new Boolean(); // Never use the Boolean constructor
p( b.toString() ); // 'false'
p( b == false ); // true, use strict equality comparison with ===
p( b === false ); // false
p( b ? 'yeah' : 'nope' ); // yeah
p( typeof b ); // object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment