Sentence Smash
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!
export function smash (words: string[]): string {
return words.join(" ");
}
func Smash(words []string) string {
return strings.Join(words, " ")
}
def smash(words):
return ' '.join(words)
function smash(array $words): string {
return implode(' ', $words);
}
Go to Kata