The Echo Chamber
Easy+15 XP
Mission Briefing
You are trapped inside the Grand Canyon! The acoustic properties here reflect sound exactly three times. You must program the Echo Chamber simulator to replicate this phenomenon.
The Concept: String Patterns
The .repeat(count) method constructs and returns a new string which contains the specified number of copies of the string on which it was called, concatenated together.
Example: "Yo".repeat(2); // Returns "YoYo"
The Objective
Your function receives a string sound.
- Use the
.repeat()method to duplicate the sound exactly 3 times. - Return the repeated string without adding any spaces!
01EXAMPLE 1
Input
sound = "Ha"Output
"HaHaHa"Constraints
- Return the repeated string.
CoreStrings
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
sound"Help"
Expected Output
HelpHelpHelp
Click RUN to test your solution