So far, we have worked with an array of (single) values as an input, but what would happen if your input happened to be an array of arrays? If you consider this to be a farfetched case, there are many possible scenarios where this could apply:
- For some applications, you could have a table of distances, which in JavaScript would actually be an array of arrays: distance[i][j] would be the distance between points i and j. How could you find the maximum distance between any two points? With a common array, finding a maximum would be simple, but how do you deal with an array of arrays?
- A more complex example, also in a geographical vein: you could query a geographical API for cities matching a string and the response ...