var data = {
author: "Jones",
slides: [
{ title: "Hat", color: "black" },
// Creating a conflict here.
{ title: "Cat", color: "red", author: '|!Conflicted!|' }
]
}
var template = document.body.innerHTML;
document.body.innerHTML = Mustache.render(template, data);
<ul>
{{#slides}}
<li>
Title: {{title}} <br/> <!-- this comes from the current context--the current slide -->
Color: {{color}} <br/>
Author: {{author}} <br/> <!-- this is also available from the parent context -->
</li>
{{/slides}}
</ul>
<span>Author: {{author}}</span> <!-- used again directly in it's context -->
External resources loaded into this fiddle: