The last filter returns either the last element of an array or the last value of a key-value pair or the last character of a string.
{{ [1, 2, 3, 4]|last }}
Result
4
{{ { a: 1, b: 2, c: 3, d: 4 }|last }}
Result
4
{{ '1234'|last }}
Result
4