Write a function called makeSentence that takes
3 words — an animal, a place, and an action —
and gives back one fun sentence that uses all three words.
makeSentencemakeSentence("dog", "moon", "danced")Try the finished version first so you know what you're building: open the Word Maker demo ➜
You can glue text and words together with + like this:
"A " + animal + " went to the " + place
Your function must give the sentence back using the word return:
return "A " + animal + " ...";
function makeSentence(animal, place, action) {
return "One day, a " + animal + " went to the " + place + " and " + action + " all day!";
}
Type it in, make it pass, then change the sentence to your own!