Atom - - Tail (First)

Characters:

Tags: array

Arity: monadic

This atom is monadic, which means it takes one argument.

Functionality

Pop and return the last element of a list (modifies the list).

Details

If the list is empty, returns zero. This mutates the original object itself, so 1,2,3 Ṫ,⁸Ɗ yields [3, [1, 2]], not [3, [1, 2, 3]]. If you do not want to modify the list, you can access the last element using 0ị$; however, a clever trick you can employ is ṛ/ (as long as your list isn't empty). This is technically less efficient because you reduce the whole list whereas random access is constant, but can save you a byte over 0ị$ if you would need the $ to group those links.