/
pop

pop

Removes the last element from an array and returns array with remaining elements. If an integer is passed as argument, this amount of elements will be removed.

Input:

{{ "John, Paul, George, Ringo" | split: ", " | pop | join: ", " }}

Output:

"John, Paul, George"

Input:

{{ "John, Paul, George, Ringo" | split: ", " | pop: 2 | join: ", " }}

Output:

 

Related content

shift
More like this
push
More like this
unshift
unshift
More like this
Filters
Filters
More like this
to_json
to_json
More like this
collection
collection
More like this