Map react items with separator

I just wanted to share a little snippet that took me a few minutes to write but that is really useful. Let’s say you want to display a list of items separated by a string, or a line break. There are lots of options here: but they are not very elegant.

How about if you could write something like:

and get a list of links, separated by line breaks?

Well you can. Here is the code:

There are simpler ways of writing this but I wanted to understand how iterators work.