Skip to content

Instantly share code, notes, and snippets.

@dudadornelles
Created December 7, 2012 23:02
Show Gist options
  • Save dudadornelles/4237298 to your computer and use it in GitHub Desktop.
Save dudadornelles/4237298 to your computer and use it in GitHub Desktop.
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