Forum Discussion
tstack
8 years agoFormer Employee
You can use the sl.zip() method to join the arrays together by index. The result will be an array of 3-element arrays, so then a map() will be needed to convert the triples into objects.
sl.zip($groceryStore.fruits.appleArray,
$groceryStore.fruits.orangeArray,
$groceryStore.fruits.bananaArray)
.map(x => { appleArray: x[0], orangeArray: x[1], bananaArray: x[2] })
travis
8 years agoNew Contributor
Yep! That worked wonderfully. Thank you!
Actual code:
sl.zip((jsonPath($, “$translations[].locale")), (jsonPath($, "$translations[].body”)), (jsonPath($, “$translations[*].title”))).map(x => {locale: x[0], body: x[1], title: x[2] })