Added given an array of objects and the name of a key, return the array sorted by the value.