Skip to content

show arrays in comma separated way using last #821

@afattahi54

Description

@afattahi54

I want to print a list as a comma separated values of an array.

I found below code works in some implementation (ex: mustache

const myArray = ["apple", "banana", "orange"];
const template = "{{#myArray}}{{.}}{{^last}}, {{/last}}{{/myArray}}";
const output = Mustache.render(template, { myArray });
console.log(output); // Output: "apple, banana, orange"
````

I have test and it seems that there is no `last` tag. 

Is there alternative?  what is the best way to have this result

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions