Overloads can return different types based on input. Here, slicing a string should return a string. Slicing a string array should return a string array.
Write the overloads first, then one body using Array.isArray and the built-in slice method. Handle the optional end index.
function head(xs: string[]) {
return xs.slice(0, 1);
}
Create a sliceEither that slices strings or string arrays.