Step 1. I need to merge 3 arrays based on the indexes.
Step 2. If two items in the first array match, I want to merge their indices.
Input:
datesArray = ["2017-04-20", "2017-04-27", "2017-04-20"]
timesArray = ["13:00", "18:00", "14:00"]
pricesArray = ["40", "60", "50"]
Output:
[
{
"date": "2017-04-20",
"times": [
"13:00",
"14:00"
],
"prices": [
"$40.00",
"$50.00"
]
},
{
"date": "2017-04-27",
"times": [
"13:00"
],
"prices": [
"$30.00"
]
}
]
Thanks for your help.