I have a json
var Model = { listAll: function() { var boxes = [{ you:'128'; him:'250'; me:'56' }, { you:'72'; him:'8'; me:'101' }, { you:'224'; him:'97'; me:'35' }, { you:'81'; him:'35'; me:'688' }]; return boxes;
} };and I want to SORT it according to property "him" ascendingly.
then I want to throw it in a "for" loop to list all the data of the json ascendingly accordingly to "him" on webpage. The code goes like this:
<% for(var i=0; i <%= boxes.him %> <%= boxes.you %> <%= boxes.me %>
<% } %>
Can anyone teach me how to do it?