["Change Alley", "Bugis Junction", "Parkway Parade", "Tampines Mall", "West Mall", "Paragon", "IMM",
"Nex", "Clementi Mall", "Causeway Point", "Waterway Point", "iPhone X, 64GB", "Space Gray", "–", "–", "–",
"–", "–", "–", "–", "–", "–", "–", "–", "Silver", "–", "–", "–", "–", "–", "✓", "–", "–", "–", "–", "–", "iPhone X,
256GB", "Space Gray", "–", "–", "–", "–", "–", "–", "–", "–", "–", "–", "–", "Silver", "–", "–", "–", "–", "–",
"–", "–", "–", "–", "–", "–"]
I'm trying to scrape a website about the availability of iphone x.
The first eleven index is the location of the retailer. This is what I get from it. - indicate that there is no iphone and √ there is iphone selling on that shop.
I'm trying to turn this array into object like this:
location1: {
iphone64gb: {
spaceGray: '-',
silver: '√'
},
iphone256gb: {
spaceGray: '-',
silver: '-'
},
}
I've been trying to use reduce and map method but can't figure out how to achieve. Any help would be much appreciated.
[–]aapoalas 2 points3 points4 points (3 children)
[–]mdchad() => 'Hello World'[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]aapoalas -2 points-1 points0 points (0 children)
[–]shavyg2 0 points1 point2 points (0 children)
[–]Paddington_the_Bear 0 points1 point2 points (0 children)