Skip to content

Instantly share code, notes, and snippets.

View renatoargh's full-sized avatar
🚀

Renato Gama renatoargh

🚀
View GitHub Profile
var personFactory = function(id, name, age){
var _id = id;
var _name = name;
var _age = age;
var personPrototype = {
getId: function(){
return _id;
},
setId: function(id){
function teste(){ }; //1
var teste = function teste(){ }; //2
var teste = function(){ }; //3
var objeto = { //4
teste: function(){ };
};
(function(nome){
console.log("Olá " + nome + "!");
})("Renato Gama"); //Loga "Olá Renato Gama!"
var pessoa = (function(nome){
var _nome = nome; //1
return {
getNome: function() { //2
return _nome; //3
}
};
function princesa() {
var aventuras = [];
function principe() { };
var unicornio = { },
dragoes = [ ],
esquilo = "Olá!";
historia: function() {
return aventuras[aventuras.length - 1];
}
};
}
var menininha = princesa();
menininha.historia();