Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor template Blaze how to return only first element of array

For example I have an array: var arr = ['a', 'b'] and want to get only first element in template

like image 429
Ivan M Avatar asked Feb 20 '15 13:02

Ivan M


1 Answers

Use {{arr.[0]}}. And this is now at least 30 characters.

https://github.com/meteor/meteor/blob/devel/packages/spacebars/README.md#identifiers-and-paths

like image 92
Peppe L-G Avatar answered Nov 04 '22 12:11

Peppe L-G