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

Popular posts from this blog

How to Add Firebase Analytics to Your NativeScript Mobile App

sidemenu refresh through events

push multiple data in array(select and disselect items in array)