Skip to content

Mention array access in Built-in Helpers#each docs #188

Description

@albedoa

If a user iterates over an array of arrays using an #each helper, and if the user wants to access specific elements within each array, then the user can do so like:

<ul class="tuples">
  {{#each tuple}}
    <li>{{this.[0]}} {{this.[1]}}</li>
  {{/each}}
</ul>

The this.[0] format is not documented in the Built-in Helpers page and is not intuitive or even guessable to those coming from languages with bracket-accessible array elements whose typical syntax is e.g. this[0].

Faced with a parse error, and after checking the documentation, the user will probably seek the solution from a third party. It would be nice if a note were added to the Built-in Helpers page instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions