I was going to write an inline response in the forum, but it became easier to write a notebook so that the examples are runnable. Perhaps one day we’ll be able to use Observable notebooks in our forums, but for now, here’s a link:
I was using the “return array” trick, but I wonder if there would be a performance issue if I were to, say, plot all the numbers (a lot of them) and it keeps having to redraw everything.
The spread operator is not really “reactive”, only giving the full array at the end.