Beginner
Defaults and Rest
join should glue words together with a separator. Give separator the default ", " and collect all remaining arguments in a rest parameter words (an array of strings).
join(undefined, "a", "b", "c") must print a, b, c, and join(" - ", "x", "y") must print x - y.
What Check tests
- Your code has no type errors
- The console prints
a, b, candx - y - A number among the words is rejected
- Calling
join()with no words is allowed
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Press Run to see the page.
Console
Nothing printed yet.