Answers for "Mustache - How to detect array is not empty?"

0

Mustache - How to detect array is not empty?

Using {{#users.length}} works great if you want the inner statement to repeat for every element of the array, but if you only want a statement to only run once, you can use:

{{#users.0}}
...
{{/users.0}}
{{^users.0}}
...
{{/users.0}}
Posted by: Guest on September-27-2021

Code answers related to "Mustache - How to detect array is not empty?"

Browse Popular Code Answers by Language