Created
November 1, 2014 06:52
-
-
Save ready4god2513/32afd776c28d04fe44aa 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
Array.prototype.alternate = function(other){ | |
var result = []; | |
this.forEach(function(i){ | |
result.push(i); | |
if(other.length > 0){ | |
result.push(other.shift()); | |
} | |
}); | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment