Array Length

You give another parameter to the function that's the length. Or you terminate the array with a unique value.