JS backend: Make ArrayList.toString consistent