Question: 1 point 6. Consider the following function named compose that has two string parameters, one named word and one named separator, and returns a string

1 point 6. Consider the following function named compose that has two string parameters, one named word and one named separator, and returns a string of the word three times with the separator in between each pair of words. The function is shown below with missing code and two calls to the function. function compose(word, separator) { // missing code } var phrase = compose("duck", "goose"); print(phrase); var phrase2 = compose("meow", "-"); print(phrase2); Here is the corresponding output to those calls to the function: duckgooseduckgooseduck meow-meow meow Which one of the following is the correct missing code for this function? return word + separator + word + separator + word; var temp = word + separator: var answer = temp + temp + temp: return answer: var answer = word + separator: answer = answer + answer + answer; return answer: return word + separator, return word + separator; return word
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
