implode
The implode function joins array elements or object values into a single string using the specified delimiter. It’s similar to joinWith but also handles objects.
Syntax
Section titled “Syntax”{input | implode:delimiter}Parameters
Section titled “Parameters”input(array/object/other): The collection to joindelimiter(string): The separator to place between elements
Returns
Section titled “Returns”- For arrays: String with all elements joined by delimiter
- For objects: String with all values joined by delimiter
- For other types: Returns the input unchanged
Examples
Section titled “Examples”Array joining
Section titled “Array joining”{["apple", "banana", "orange"] | implode:", "}// Returns: "apple, banana, orange"Object values
Section titled “Object values”{{"first": "John", "last": "Doe", "role": "Admin"} | implode:" "}// Returns: "John Doe Admin"Line breaks
Section titled “Line breaks”{["Line 1", "Line 2", "Line 3"] | implode:"\n"}// Returns: "Line 1\nLine 2\nLine 3"No delimiter
Section titled “No delimiter”{["A", "B", "C"] | implode:""}// Returns: "ABC"Semicolon separation
Section titled “Semicolon separation”{["task1", "task2", "task3"] | implode:"; "}// Returns: "task1; task2; task3"Non-array input
Section titled “Non-array input”{"simple string" | implode:", "}// Returns: "simple string" (unchanged)Object properties to CSV
Section titled “Object properties to CSV”{{"id": "001", "name": "Test", "status": "Active"} | implode:","}// Returns: "001,Test,Active"Use Cases
Section titled “Use Cases”- Creating comma-separated value strings
- Building formatted lists from arrays or objects
- Generating CSV-like output from object values
- Creating readable lists in reports
- Joining form field values for display
Differences from joinWith
Section titled “Differences from joinWith”implodehandles both arrays and objectsimplodeextracts values from objects (ignoring keys)implodereturns non-collection inputs unchangedjoinWithis array-specific
When used with objects, only the values are joined (keys are ignored). The order of values depends on the JavaScript engine’s object property iteration order.