Monday 12 June 2017

How to change Array of Object into Single object? (javascript)

I have this sample of code

a = [ { "apple" : 1 } , { "orange" : 2 } ]

and how would I change this to the following?

a = { "apple" : 1,  "orange": 2 }



via Kit Ho

No comments:

Post a Comment