Skip to content

Instantly share code, notes, and snippets.

@jesselima
Created January 2, 2018 23:45
Show Gist options
  • Save jesselima/6e780e730947094d45e0883a3b0d6416 to your computer and use it in GitHub Desktop.
Save jesselima/6e780e730947094d45e0883a3b0d6416 to your computer and use it in GitHub Desktop.
entendendo-es6 created by jesselimatech - https://repl.it/@jesselimatech/entendendo-es6
console.log('-----\n-----');
var canais = ['sbt', 'globo', 'record'];
canais.forEach(function(canal){
canais.push('cultura'); // este item foi adicionado depois da primeira chamada dpo callback e não entrará na intereção do forEach
console.log(canal);
});
// já neste a cultura foi adicionado
console.log('-----\n-----');
canais.forEach(function(canal){
console.log(canal);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment