The current templating proposal supports a small set of
template commands - including if, else, and each statements. The number of
template commands was deliberately kept small to encourage people to place more
complicated logic outside of their templates.
Even this small set of template commands is very useful
though. Imagine, for example, that each contact can have zero or more phone
numbers. The contacts could be represented by the JavaScript array below:

The template below demonstrates how you can use the if and
each template commands to conditionally display and loop the phone numbers for
each contact:

If a contact has one or more phone numbers then each of the
phone numbers is displayed by iterating through the phone numbers with the each
template command:

The jQuery team designed the template commands so that they
are extensible. If you have a need for a new template command then you can
easily add new template commands to the default set of commands.