61
rated 0 times
[
62]
[
1]
/ answers: 1 / hits: 54080
/ 11 Years ago, fri, december 27, 2013, 12:00:00
How I can convert an array to an array of JavaScript objects.
For example I have an array as
data = [
[fruits,frozen,fresh,rotten],
[apples,884,494,494],
[oranges,4848,494,4949],
[kiwi,848,33,33]
]
I want to convert it to a name value pair.
For example, first object in the resulting collection would be
{fruits: apple, frozen: 884, fresh: 494, rotten: 494}
and so on for rest of the data.
More From » arrays