Created
February 28, 2014 00:22
-
-
Save mbildner/9262658 to your computer and use it in GitHub Desktop.
operator overloading js
This file contains hidden or 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
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<script> | |
function Person (first, last) { | |
this.first = first; | |
this.last = last; | |
this.toString = function () { | |
var greeting = "hello from " + this.first + " " + this.last; | |
alert(greeting); | |
}; | |
}; | |
var moshe = new Person('moshe', 'bildner'); | |
+moshe; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment