Skip to content

Instantly share code, notes, and snippets.

@nomyfan
Created May 16, 2020 14:02
Show Gist options
  • Save nomyfan/4ee6d61ad0ed03e7981a3a95623123f2 to your computer and use it in GitHub Desktop.
Save nomyfan/4ee6d61ad0ed03e7981a3a95623123f2 to your computer and use it in GitHub Desktop.
JS zip iteration adapter
Array.prototype.zip = function(ano) {
return [...Array(Math.min(this.length, ano.length))].map((_, i) => [this[i], ano[i]]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment