Skip to content

Instantly share code, notes, and snippets.

@bbtdev
Created November 6, 2018 08:12
Show Gist options
  • Select an option

  • Save bbtdev/665cb5402ba51da58169a3b0f57d430a to your computer and use it in GitHub Desktop.

Select an option

Save bbtdev/665cb5402ba51da58169a3b0f57d430a to your computer and use it in GitHub Desktop.
06:42 <za1b1tsu> So I have a var: ['a','b']. How can I get the last element?
06:54 <flowerysong> za1b1tsu: {{ var | last }}
06:55 <flowerysong> Or {{ var[-1] }}
07:19 <za1b1tsu> but what is this syntax called {{ var | last }} etc. It is not yaml, right?
07:19 <@jborean93> it's jinja2
07:20 <@jborean93> http://jinja.pocoo.org/docs/2.10/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment