Array.prototype.joinbeginnerconst nums = [1, 2, 3]
nums.join(' - ') // β '1 - 2 - 3'
nums.join('') // β '123'Pass any string as the separator to join() to control how elements are delimited.
join() accepts any string as the separator, including empty string, spaces, or multi-character strings.
Challenge: Implement joinWith(arr, sep) that joins the array using the given separator.
joinWith(['a', 'b', 'c'], '-') // β 'a-b-c'
joinWith(['a', 'b', 'c'], '') // β 'abc'