The problem is that you are passing a string to the JS column, and then trying to process it as an array.
So you need to do a couple of things:
- Firstly, remove the enclosing square brackets. You can do that with a simple template column.
- Secondly, adjust the JS code to coerce the string into an array of numbers. Just replacing the first line as follows will take care of that:
var arr = p1.split(',').map(Number);