I went through multiple StackOverflow answers and googled thoroughly before coming in here to help.
I have an array which includes arrays, as shown below.
Please how would I go about finding an array with the highest first value, in this example 30 and print out the whole array which includes the highest value as the result, so in this case the answer is [ 30, '0.26', [ 'oranges', 'with apples' ], [ 'bananas', 'with apples' ] ]
?
I know how to get the highest value, but I can't figure out how to print the whole array including the highest value.
Thank you!!
let arr = [
[
10,
'0.07',
[ 'oranges', 'with apples' ],
[ 'bananas', 'with apples' ]
],
[
20,
'0.15',
[ 'oranges', 'with apples' ],
[ 'bananas', 'with apples' ]
]
[
30,
'0.26',
[ 'oranges', 'with apples' ],
[ 'bananas', 'with apples' ]
]
]