v153 · iterator join

The array you were building anyway

Both routes produce the identical string. One of them builds an array of every value first and then throws it away. This page runs them side by side at a size you choose and reports what each one actually cost.

Measure both

Same input, same output, two routes
route median ms peak intermediate output length
Not run yet.
Press the button.

Time is not the argument here, and the numbers say so: Array.prototype.join runs inside the engine, so racing it against a hand-written accumulation loop measures the workaround rather than the feature. The peak intermediate column is the argument — one route holds every value at once, the other holds none.

What the heap says

Browsers do not hand out a reliable per-operation allocation figure, so this page does not invent one. Where performance.memory exists it is sampled around each route and reported below with its own caveats; where it does not, the row says so rather than showing a plausible-looking number.

Heap delta across one run, where the browser exposes it
routeused heap deltaconfidence
Not run yet.

see also