Lets say I have 2 arrays as follows
const cols = [A,B,C,D]
const rows = [
[
'Row 1',
A : 2,
B : 5
],
[
'Row 2',
B : 2,
C : 5
]
]
Is there anyway to join it to get the following result like a left join in SQL, Any help is most appreciated thanks
[
[
'Row 1',
A : 2,
B : 5,
C : 0
D : 0
],
[
'Row 2',
A : 0,
B : 2,
C : 5,
D : 0,
]
]```