This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Description
Some other languages provide a way to join elements into a single string without having to convert the iterator to an array.
It is disappointing that this proposal does not provide a similar API.
- Java Stream API:
iterator.collect(Collectors.joining(delimiter))
- Kotlin:
iterator.joinToString(delimiter)
- C#/VB LINQ:
String.Join("delimiter", iterator)
With the current specification, we have to call .toArray().join(). If JS engines do not estimate the length of the result string in advance, this array allocation is extra and unnecessary. They should.
P.S.
- Users may expect that the iterator has .join method like arrays or the above languages
.toArray() in .toArray().join() is a little bit verbose and looks like a little boilerplate