← Back to challenges

WordCharWord

JavaScriptHardstringsformatting

Instructions

Create a function that will put the first argument, a character, between every word in the second argument, a string.

Examples

add("R", "javascript is fun") ➞ "javascriptRisRfun"

add("#", "hello world!") ➞ "hello#world!"

add("#", " ") ➞ "#"

Notes

Make sure there are no spaces between words when returning the function.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Volume of a Pizza