Created
December 7, 2012 23:02
-
-
Save dudadornelles/4237298 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
var pessoa = function (nome, sobrenome) { | |
var obj = {}; | |
obj.getNome = function () { | |
return nome; | |
}; | |
obj.getSobrenome = function () { | |
return sobrenome; | |
}; | |
obj.getNomeSobrenome = function () { | |
return nome + " " + sobrenome; | |
}; | |
return obj; | |
}; | |
var duda = pessoa("Duda", "Dornelles"); | |
var desiree = pessoa("Desireé", "Santos"); | |
duda.getNome(); | |
//Duda | |
desiree.getNome(); | |
//Desirre |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment