Created
April 27, 2014 11:07
-
-
Save hakatashi/11343011 to your computer and use it in GitHub Desktop.
#実用的なhelloworld
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
String.prototype.capitalize = function() { | |
return this.charAt(0).toUpperCase() + this.slice(1); | |
}; | |
var Greet = function(greeting, objection) { | |
this.greeting = greeting || 'hello'; | |
this.objection = objection || 'world'; | |
this.do = function() { | |
console.log((this.greeting + ', ' + this.objection + '!').capitalize()); | |
}; | |
return; | |
} | |
var helloWorld = new Greet(); | |
helloWorld.do(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment