def sort_by_length(arr):
    """
    Takes an array of strings as an argument and returns a sorted array containing the same strings, ordered from
    shortest to longest.
    :param arr: an array of strings.
    :return: array sorted from shortest to longest.
    """
    return sorted(arr, key=len)