I am trying to sort a map which is inside a filter and return the map
var sort = this.attr('component').attr('sort');
if (sort == 'Price Descending')
{
return this.attr('%root.products').filter(function(product) {
// How can I sort 'product' here before returning?
return (product.attr(product.attr('active') !== 'f';
});
}
As mentioned above how can I sort the product callback variable before returning and comparing it.
Any help would be appreciated.