Hi,
I don't know how to sort multidimensional arrays.
there is an array:
var item_unitaz = [ {'item_id':1, 'article':'DE23421312', 'name':'Hello','type':2}, {'item_id':2, 'article':'DE12421442', 'name':'Until','type':32}, {'item_id':3, 'article':'DE78677833', 'name':'Sparrow','type':68}, {'item_id':4, 'article':'DE23442235', 'name':'Rooster','type':45}];
Need to sort this array by value
Type in the correct order
(2, 32, 45, 68)All I thought of is:
for (var i = 0; i < item_unitaz.length; i++) { console.log(item_unitaz[i].type.sort(function(a,b){return a - b})); }
Of course that didn't work... Please help!