I have 3 arrays:
keys = ['first','second']
ycor = [200,400]
xcor = [[375,75],[75]]
I am thinking of how to get them to:
[
{
'first': 200,
'second': [375,75]
},
{
'first': 400,
'second': [75]
}
]
The primary attempt was to use the forEach() function, but only managed to reach a 2 sided case and unidentifiable by node.
var result = []
keys.forEach((i,v,w) => result[i] = (xcor[v],ycor[w]))
Is it possible at all?