I have the following arrays:
const prev = [A, C, D, E]
const curr = [A, B, D, F]
What is the most elegant way of producing the following output?
[[A, A], [null, B], [C, null], [D, D], [E, null], [null, F]]
A, B, C, .. are objects that can be mapped on an equal field, e.g.:
A = {id: "A", ... }
The order of the final array doesn't matter.
EDIT: The two arrays are not necessarily the same length.