Created
July 21, 2009 05:03
-
-
Save eligrey/151126 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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