Created
May 22, 2010 01:12
-
-
Save yeco/409646 to your computer and use it in GitHub Desktop.
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
| function Ball (type) { | |
| this.type = type; | |
| this.color = "red"; | |
| this.getInfo = getBallInfo; | |
| } | |
| function getBallInfo() { | |
| return this.color + ' ' + this.type + ' Ball'; | |
| } | |
| // uso | |
| var ball = new Ball('round'); | |
| ball.color = "reddish"; | |
| alert(ball.getInfo()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment