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.
마지막 업데이트: 2024. 6. 5. 오후 11:37:24