The right way to do this is _.template
Example
If your structure is like this:
var list = {"partners":[
{"username":"fangonk","profileImg":"fangonk.jpg"},
{"username":"jane","profileImg":"jane.jpg"},
{"username":"tom_jones","profileImg":"tom.jpg"}
]};
You can create the repeated item template (note type="text/html")
<script type="text/html" id="userItemTemplate">
<h1><%= username %></h1><img src='<%= profileImg %>' />
</script>
and put each item into the template via a loop
var uIT = $("#userItemTemplate").html();
_.each(list.partners,function(user){
$("#target").append(_.template(uIT,user));
});
OR
put the loop into your template
<script type="text/html" id="userTemplate">
<% _.each(partners,function(user,key,list){ %>
<h1><%= user.username %></h1><img src='<%= user.profileImg %>' />
<% }); %>
</script>
then push the whole array in
var uT = $("#userTemplate").html();
$("#target2").html(_.template(uT,list));
Note that I am using lodash instead of underscore. It's compatible for the most part, but I prefer lodash because the benchmarks are faster and the library is maintained well.
.map()function, typically you'd have the callback return a value and then store the return value of the.map()call, which will be a new Array of whatever your function returned.