Created
August 23, 2013 11:44
-
-
Save sanandnarayan/6318439 to your computer and use it in GitHub Desktop.
why cant Dhone introduce himself?
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
// question: why cant Dhone introduce himself? | |
// please fix it. Make Dhoni introduce himself! | |
var Man = function( name ) { | |
this.name = name | |
} | |
Man.prototype.introduce = function() { | |
console.log( this.name ) | |
} | |
// make a new instance of a Man | |
var dhoni = new Man('Dhoni') | |
// make Dhoni introduce himself immediately | |
dhoni.introduce() | |
// in 1 second we want Dhoni to introduce himself again | |
setTimeout( dhoni.introduce , 1000 ) |
mwcz
commented
Jan 7, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment