Menu
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

Template Filter - last


Example

Return the last item in a list:

<h1>{{ fruits|last }}</h1>
Run Example »

Definition and Usage

The last filter returns the last item of an object.

For strings, the last filter returns the last character:

Example

Return the last character of a string:

<h1>{{ firstname|last }}</h1>
Run Example »

Use the first filter to return the first item.


Syntax

Template filters are defined by using a pipe | character followed by the name of the filter.

{{ value|last }}