I am looking for a JavaScript function which accepts two string arrays of equal length and outputs a single string array which is the same length as the input arrays, containing the element-wise-concatenated strings of the input arrays. Is there a built-in JavaScript function which does this?
Additionally, I would like to add in a string between the concatenated elements when the element-wise concatenation is done. For example, so that this would be true for each i:
outputArray[i] = inputArray1[i] + " - " + inputArray2[i]
zip. The closest thing in the js standard library is areducelike Nina has posted. There's no reason why you couldn't make your ownzipfunction.