You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also found I can write {% x = ['up', 'down', 'left', 'right'] %}, then use {{ x[1] }}, so it's not too hard to work around, but the error message did confuse me for a while.
I was trying to index a literal array, to get a label, for example:
['up', 'down', 'left', 'right'][1]
But this doesn't work, I get:
expected a filter or a variable end
Now, I can fix this by writing:
['up', 'down', 'left', 'right'] | nth(n=1)
But it took me a while to find that, and I expected the 'obvious thing' to work.
The text was updated successfully, but these errors were encountered: