Handlebars:
Template
{{#each persons}}
  {{>person person=.}}
{{/each}}
Preparation-Script
Handlebars.registerPartial(
    "person", 
    "{{person.name}} is {{person.age}} years old.\n"
)
Input
{
  persons: [
    { name: "Nils", age: 20 },
    { name: "Teddy", age: 10 },
    { name: "Nelson", age: 40 },
  ],
}
Output
  Nils is 20 years old.
  Teddy is 10 years old.
  Nelson is 40 years old.