❓ Sentence Smash
Q. Write a function that takes an array of words and smashes them together into a sentence and returns the sentence. You can ignore any need to sanitize words or add punctuation, but you should add spaces between each word. Be careful, there shouldn't be a space at the beginning or the end of the sentence
✔ Solution
function smash (words) {
return words.join(" ");
};
let test1 = ['hello','world','this','is','great'];
console.log(smash(test1));
//hello world this is great
Check
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/join