Skip to content
Permalink
Browse files

changing slice() to '...' for array copying

  • Loading branch information...
getify committed Jan 29, 2018
1 parent 6176963 commit 8a6578e7080b46de50d3a7303f512b05a515e0f6
Showing with 2 additions and 2 deletions.
  1. +2 −2 ch11-code/fp-helpers.js
@@ -86,8 +86,8 @@ function uncurry(fn) {

function zip(arr1,arr2) {
var zipped = [];
arr1 = arr1.slice();
arr2 = arr2.slice();
arr1 = [...arr1];
arr2 = [...arr2];

while (arr1.length > 0 && arr2.length > 0) {
zipped.push( [ arr1.shift(), arr2.shift() ] );

0 comments on commit 8a6578e

Please sign in to comment.
You can’t perform that action at this time.