Skip to content

Instantly share code, notes, and snippets.

@edinsoncs
Created November 21, 2015 06:02
Show Gist options
  • Save edinsoncs/cef1e982c5bddb1111e2 to your computer and use it in GitHub Desktop.
Save edinsoncs/cef1e982c5bddb1111e2 to your computer and use it in GitHub Desktop.
elevent
/*shift*/
/*Shift borraremos*/
function shiftFn(arr) {
var a = arr;
var result = a;
var int = setInterval(function(){
result.shift();
console.log('eliminando con shift ' + result.shift());
var u = undefined;
var x = result.shift();
var s = "STOP..."
if(x == u) {
console.log("no tengo mas que mostrar: " + s + "!!!");
clearInterval(int);
}
}, 2000);
//return result;
}
shiftFn(['hola','que tal', 'como estan', 'todo bien', 'genial', 'javascript', 'i love you', 'developer']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment