I have the following structure
[
{ type: 'total_users', total: '393647' },
{ type: 'total_male_users', total: '259555' },
{ type: 'total_female_users', total: '134092' },
{ type: 'active_users', total: '1232' },
{ type: 'active_male_users', total: '144' }
]
I'm trying to convert this into an object (something like the following)... I would like to reference the object like "blah.total_users"
{
'total_users': '393647',
'total_male_users',
'total_female_users',
'active_users',
'active_male_users'
}
Being trying the following but I'm a way off - returns an array and errors with the return structure below.
statistics = statisticsResult.rows.map((data) => [data.type]: data.total)
thankyou