There is an array of objects, you need to sort it by field value, placing elements with the same value next to each other. Example:
var arr1 = [ {str:'strA'}, {str:'bStr'}, {str:'Cstr'}, {str:'strA'}, {str:'bstr'}; ]; //исходный массив var arr1 = [ {str:'strA'}, {str:'strA'}, {str:'bStr'}, {str:'bstr'}, {str:'Cstr'}; ]; //исходный массив In the "arms" there are knockout.js and underscore.js .