Skip to content

Instantly share code, notes, and snippets.

@eligrey
Created July 21, 2009 05:03
Show Gist options
  • Save eligrey/151126 to your computer and use it in GitHub Desktop.
Save eligrey/151126 to your computer and use it in GitHub Desktop.
var results = [],
code = 'new Person("Elijah", "Grey")';
function Person(firstname, lastname) {
this.name = {
first: firstname,
last: lastname
};
}
results.push(code + " == " + eval(code));
results.push("("+ code + ").toString(true) == "+eval(code).toString(true));
Person.prototype.toString = function() {
return this.name.first + " " + this.name.last;
};
results.push(code + " == " + eval(code));
alert(results.join("\n\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment