filter array object names
const sortBy = fn => {
const cmp = (a, b) => -(a < b) || +(a > b);
return (a, b) => cmp(fn(a), fn(b));
};
const CategoryName = o => o.CategoryName;
const CategoryName1 = sortBy(CategoryName);
this.datapushnew3.sort(CategoryName1);
this.datapushnew4=this.datapushnew3;
console.log(this.datapushnew3.map(CategoryName));
console.log(this.datapushnew3 ,"this.datapushnew2.sort()");
}
Comments
Post a Comment