-
-
Save mwcz/8306555 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
// question: why cant Dhoni 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 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment