Skip to content

Add support for Array.includes to amp-bind #7378

@kul3r4

Description

@kul3r4

In order to get code readability, we could add Array.contain to amp-bind. At the moment you could achieve the same behaviour by using Array.indexOf() but makes the expressions more complex.
For example,
myArray[index].values.indexOf(anotherIndex) >= 0 ? doSomething : doSomethingElse
could become
myArray[index].values.contains(anotherIndex) ? doSomething : doSomethingElse

@choumx

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions