September 2017
Intermediate to advanced
216 pages
6h 8m
English
Since you don't always have a list of simple values with which to work, you need a way to zip more complex values together. If you're trying to zip lists of maps together, you probably don't want an array of maps passed to the next method in the chain. Using the zipWith() method, you can explicitly transform the zipped value using an iteratee that you provide, as shown here:
const names = List.of( Map.of('name', 'Jeremy'), Map.of('name', 'Garry'), Map.of('name', 'Katie'));const roles = List.of( Map.of('role', 'Engineer'), Map.of('role', 'Designer'), Map.of('role', 'Programmer'));const ages = List.of( Map.of('age', 34), Map.of('age', 23), Map.of('age', 36));names .zipWith( (...colls) => Map().merge(...colls), roles,Read now
Unlock full access