How can I access the values of the first or a specific object in an array based on an index using ES6?
arrayOne =[
{ child: [
{e1: 'ABCD', e2: 'BCDF'},
{e1: '1234', e2: '5689'},
{e1: 'QAZX', e2: 'WESD'}]},
{ child: [
{e1: 'UHYT', e2: 'QYDG'},
{e1: '9568', e2: '4587'},
{e1: 'ISSF', e2: 'QEIR'}
]}
]
The desired output is
arrayTwo = [['ABCD', 'BCDF'], ['1234', '5689'], ['QAZX', 'WESD']]'
Additionally, how do I ensure my code remains dynamic if there are changes to variable names like 'child' or 'e1' or 'e2'?