Handlebars:
Template
{{#each people}}
   {{.}} lives in {{lookup ../cities @index}}
{{/each}}
Preparation-Script
// Handlebars.registerHelper('loud', function(string) {
//    return string.toUpperCase()
// });
Input
{
  people: ["Nils", "Yehuda"],
  cities: [
    "Darmstadt",
    "San Francisco",
  ],
}
Output
   Nils lives in Darmstadt
   Yehuda lives in San Francisco
最后更新: 2020/1/11 15:46:21