-
-
Save desireesantos/4237963 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