Skip to content

Instantly share code, notes, and snippets.

@novemberborn
Created October 7, 2010 14:27
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 novemberborn/615171 to your computer and use it in GitHub Desktop.
Save novemberborn/615171 to your computer and use it in GitHub Desktop.
var s = "string";
String.prototype.testEqual = function(){ return this == s; };
String.prototype.testStrict = function(){ return this === s; };
s.testEqual(); // true
s.testStrict(); // false
s = new String(s);
s.testEqual(); // true
s.testStrict(); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment