Skip to content

Instantly share code, notes, and snippets.

@desireesantos
Forked from dudadornelles/gist:4237298
Created December 8, 2012 01:04
Show Gist options
  • Save desireesantos/4237963 to your computer and use it in GitHub Desktop.
Save desireesantos/4237963 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