%dw 2.0
fun concatBy(element: Array<String>, by: String, result: String = ""): String = do {
  element match {
    case [] -> result
    case [x ~ xs] -> concatBy(xs, by, x ++ by ++ result)
  }
}
---
concatBy([], ",")

