javascript - want to create nested JSON for following array using Node.js -


i want create nested json using following array , separated according:

array used create json:

[ 'tc0159 - 24 ghanta', (channel name starts tc) '12pm-1659pm (timeslot) 519.00', (rate) '5pm-2259pm 714.00', '6am-1159am 323.00', 'tc0514 - 4 real news', '12pm-1659pm 128.00', '5pm-2259pm 128.00', '6am-1159am 128.00', 'tc0227 - 9 x m', '10pm-10:30pm 1105.00', '12pm-7pm 1105.00', '7am-9am 1496.00', '7pm-8pm 1105.00', '8pm-10pm 1105.00', '9am-12pm 1887.00', 'tc0224 - 9x', '10pm-10:30pm 128.00', '12pm-7pm 323.00', '7am-9am 128.00', '7pm-8pm 323.00', '8pm-10pm 128.00', '9am-12pm 128.00' ]

i want make json represented below sing above array.

{ "data": [     {         "channel_name": "channelname",         "timeslot": {             "10:00-1:00": 600,             "2:00-5:00": 800         }     },     {         "channel_name": "channelname",         "timeslot": {             "10:00-1:00": 600,             "2:00-5:00": 800         }     },     {         "channel_name": "channelname",         "timeslot": {             "10:00-1:00": 600,             "2:00-5:00": 800         }     } ]} 


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -