# Request for JS Concat

**URL:** <https://discourse.psychopy.org/t/request-for-js-concat/47608>\
**Category:** Online experiments\
**Created:** [July 31, 2026, 3:28pm UTC](https://discourse.psychopy.org/t/request-for-js-concat/47608 "2026-07-31T15:28:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taylor](https://avatars.discourse-cdn.com/v4/letter/t/c2a13f/32.png) [@Taylor](https://discourse.psychopy.org/u/Taylor)\
**Post date:** [July 31, 2026, 3:28pm UTC](https://discourse.psychopy.org/t/request-for-js-concat/47608/1 "2026-07-31T15:28:16Z")

</div>

Hi Team,

I’m not sure of the best place to submit feature requests. Should they be posted here, on the GitHub Issues page, or somewhere else?

We’ve recently discovered a bug in our experiment code that resulted in incorrect data being recorded. As part of our analysis workflow, we were calculating a standard deviation and needed to combine two lists. Because of the Auto-\>JS translation, the code ran without error, but the lists were joined using JavaScript’s `+` operator behaviour rather than Python list concatenation. As a result, two adjacent values were merged together, producing invalid output and ultimately affecting our results.

Wakefield has kindly put together a [guide](https://discourse.psychopy.org/t/wakefields-daily-tips/43371/70#p-125804-extending-lists-1) explaining this behaviour and how to avoid it. However, I wondered whether this could be addressed directly in the Auto-\>JS translation process.

Would it be possible for expressions such as:

Python

- list1 + list2

to be translated to:

JavaScript

- list1.concat(list2)

rather than:

JavaScript

- list1 + list2

This would more closely match Python’s behaviour for list concatenation and could help prevent subtle data-processing bugs that are difficult to detect until much later in the analysis pipeline.

I appreciate there may be technical reasons why this isn’t straightforward, but I thought it would be worth raising as a potential improvement.

Thanks!

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 31, 2026, 4:06pm UTC](https://discourse.psychopy.org/t/request-for-js-concat/47608/2 "2026-07-31T16:06:51Z")

</div>

The main reason why this isn’t straightforward is because you are asking for a + b to translate to different things depending on what a and b actually are. This may not be obvious from the code, and could change at any moment. I would recommend having a custom function defined in a Both component so it works the same way in both environments.
