Consider an Array that consists of nested arrays:
[
["2000-01-01", "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d1a9a8abe091b6bcb0b8bdffb2bebc">[email protected]</a>", 1, 9, 338],
["2000-01-01", "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="740c0d0e46340d151c1b1b5a171b19">[email protected]</a>", 1, 2, 159],
["2000-01-01", "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="94ecedeea7d4edf5fcfbfbbaf7fbf9">[email protected]</a>", 1, 5, 462],
["2000-01-01", "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="196160632d596078717676377a7674">[email protected]</a>", 1, 6, 417],
["2000-01-01", "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f8808182cdb89f95999194d69b9795">[email protected]</a>", 1, 3, 156],
["2000-01-01", "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fa828380ccba9d979b9396d4999597">[email protected]</a>", 1, 8, 414],
]
We aim to extract the top 2 based on the last column:
["2000-01-01", "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f28a8b88c1b28b939a9d9ddc919d9f">[email protected]</a>", 1, 8, 462],
["2000-01-01", "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e199989bd5a19880898e8ecf828e8c">[email protected]</a>", 1, 6, 417],
We can utilize Array.filter
, although implementing it in this scenario may pose a challenge.