Create a function joinArray that joins array elements with a dash ('-') and logs the result.

Output: