MCPcopy
hub / github.com/getify/Functional-Light-JS / zip

Function zip

ch11-code/fp-helpers.js:87–97  ·  view source on GitHub ↗
(arr1,arr2)

Source from the content-addressed store, hash-verified

85}
86
87function zip(arr1,arr2) {
88 var zipped = [];
89 arr1 = [...arr1];
90 arr2 = [...arr2];
91
92 while (arr1.length > 0 && arr2.length > 0) {
93 zipped.push( [ arr1.shift(), arr2.shift() ] );
94 }
95
96 return zipped;
97}
98
99function compose(...fns) {
100 return fns.reduceRight( function reducer(fn1,fn2){

Callers 3

updateStockElemsFunction · 0.85
addStockFunction · 0.85
stock-ticker.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected