how to filter data in array loop
问题 In my array is like this, var myColumnDefs = [ {a: "hh", b: "hh", c: "jk", d: "ggh", e: "hvh"}, {a: "dd", b: "gg", d: "nn", e: "rr", f: "jj"},..... ] I want to filter data and insert data in new array like this var newarray = {a,b,c,d,e,f} & another array var mysecondarray = [ {hh,hhjk,ggh,hvh}, {dd,gg,nm,rr,jj},.... ] 回答1: Assuming you want the result in arrays, then this should work. The result is in an object for further processing. var myColumnDefs = [{ a: "hh", b: "hh", c: "jk", d: "ggh"