Challenge: Write a Greeting Function
Task
Swipe to start coding
Implement a function to output a sentence:
- Name the function
myName. - The function should accept one argument,
name. - The
myNamefunction body should contain aconsole.log()statement that prints the sentence"My name is {name}". - Call the
myNamefunction three times with different names.
The output should be:
My name is {name}
My name is {name}
My name is {name}
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 6. ChapterΒ 3
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 2.5
Challenge: Write a Greeting Function
Swipe to show menu
Task
Swipe to start coding
Implement a function to output a sentence:
- Name the function
myName. - The function should accept one argument,
name. - The
myNamefunction body should contain aconsole.log()statement that prints the sentence"My name is {name}". - Call the
myNamefunction three times with different names.
The output should be:
My name is {name}
My name is {name}
My name is {name}
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 6. ChapterΒ 3
single