Created
September 22, 2017 15:06
-
-
Save DiegoPinho/6ab7f5fb90be7fd8893638deb5eb11b7 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 equipe = { | |
nome: 'es6 masters', | |
membros: [ | |
'Júlio', | |
'Matheus', | |
'Adriana', | |
'Fernanda' | |
], | |
mostraIntegrantes() { | |
// sem a arrow function, não conseguiríamos acessar this.nome | |
// teríamos que fazer this = that e então that.nome | |
this.membros.forEach(membro => { | |
console.log(membro + " faz parte de " + this.nome); | |
}); | |
} | |
} | |
equipe.mostraIntegrantes(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment