Doing some work in javascript
I have a multidimensional made up in this format ( I know it’s not an actually array object, bit it gives you an idea of the format
[
[[“ip-address”][timestamp]],
[[“ip-address”][timestamp]],
[[“ip-address”][timestamp]],
[[“ip-address”][timestamp]]
]
The array can include duplicate ip addresses and I need a way to first sort the array by timestamps and then echo out the first instance of the ip address (i.e. for each ip address I need the one with the earliest timestamp)
For example
[[“10.0.0.1”][13:01:34]]
[[“10.0.0.1”][ 13:21:56]]
[[“192.168.1.1”][23:45:12]]
[[“192.168.1.1”][12:34:42]]
Would give me the following output
10.0.0.1 = 13:01:34
192.168.1.1 = 12:34:42
I’ve had a hunt around and can’t see a way to do this so any help would be appreciated
something like this?