Join them

Report a typo

In the code below an array of words is given to the function joinThem(). Your task is to join all the words.

Use the join() method with the hyphen - character, then output the result with console.log().

Sample Input 1:

Aspire to inspire before we expire.

Sample Output 1:

Aspire-to-inspire-before-we-expire.
Write a program in JavaScript
function joinThem(words) {

}
___

Create a free account to access the full topic