i have this 3D array
var array = [
[
{
ipo: 10
}
],
[
{
ipo: 5
}
],
[
{
ipo: 15
}
],
];
i want to sort by ascending and by descending. I tried this:
array.sort(function(a, b) { //ascending
return a.ipo - b.ipo;
});
but doesn't works...
What do you suggest ? maybe i need to add for loop inside function?