JS error: Cannot read properties of undefined (reading 'toString')

URL of experiment: ReversalLearning [PsychoPy]

Description of the problem:
The experiment runs locally. I am receiving this error attempting to run the experiment online:

I believe this is likely an error in my JS. There are far too many errors created by Auto->JS, so I really prefer not to rely on it. This is an example of one place toString occurs in Builder:

I changed
feedback_text += ("\n\nYou received +" + last_points.toString());
to
feedback_text += ("\n\nYou received +" + last_points.arr.toString());
in case JS was failing to detect the object type. It did not resolve the problem.

Any stronger JS coders see what is needed here?

I believe the problem is actually in the definition of conditions in Javascript. Pavlovia will not run:
conditions = range(18,1)
I have tried a few permutations. This is the current JS:

function range(start, end) {
  return Array.from({ length: Math.abs(end - start) + 1 }, (_, index) => start > end ? start - index : start + index);
}
let conditions = range(18, 1);

which results in the error