nth
Select positions from an array with nth-pattern syntax.
Syntax
{{ value | nth:3 }}{{ value | nth:2n }}{{ value | nth:n+3 }}{{ value | nth:2,3:4 }}Example
Basic usage
1{2 "items": [3 "a",4 "b",5 "c",6 "d",7 "e",8 "f"9 ]10}1{{ items | nth:2n }}1["b","d","f"]Behavior
- Indexes are one-based. Patterns support a single position, every nth item, an offset, or positions within repeating groups.