require([
"dojo/query",
"dojo/string",
"dojo/NodeList-manipulate",
"dojo/domReady!"
], function(query, string){
var fruit = ["orange","apple","grape","cherry","plum"];
var template = "The first fruit is <strong>${0}</strong> and the last is <strong>${"+(fruit.length-1)+"}</strong>.";
fruit.sort();
query("#out").html(string.substitute(template, fruit));
});
<div id="out"></div>
strong { font-weight: bold; text-decoration: underline; }