You can use one-liner here:

```
local joined_args=$(IFS=, ; echo "${revarray[*]}")
```