79446022

Date: 2025-02-17 16:29:49
Score: 0.5
Natty:
Report link

No guarantee that this works for all cases, but in a Drupal context (Drupal 9/Twig 2) I could successfully compare a variable to -1 in a for loop to differentiate numeric from non-numeric keys:

{% for i, items %}
  {% if i > -1 %}
    ...
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Konstantin