I am looking to restructure my object by removing a nesting. How can I achieve this using JavaScript?
Actual:
var a = [
{ clickedEvents:
{
'event-element': 'a',
'event-description': '',
'timestamp': 1506673474238,
}
},
{ clickedEvents:
{
'event-element': 'b',
'event-description': '',
'timestamp': 1506673474123,
}
}]
Expected:
var a = [
{
'event-element': 'a',
'event-description': '',
'timestamp': 1506673474238,
},
{
'event-element': 'b',
'event-description': '',
'timestamp': 1506673474123,
}]