justaphase
asked on
json array, remove all elements contained in another json array
Hello Experts,
I've seen several examples on the web filtering arrays, using for example jQuery grep.
But all i see i a little more simple than what i want.
Maybe this is more simple that i think..
I have this two arrays:
How can i do this?
Thx in advanced :)
Miguel
I've seen several examples on the web filtering arrays, using for example jQuery grep.
But all i see i a little more simple than what i want.
Maybe this is more simple that i think..
I have this two arrays:
var searchtag_catg = [{ id: 2, tb: 'text2', search: 'test2'},{ id: 4, tb: 'text4', search: 'test4'}];
var categories = [{ id: 1, tb: 'text1', search: 'test1'},{ id: 2, tb: 'text2', search: 'test2'},{ id: 3, tb: 'text3', search: 'test3'},{ id: 4, tb: 'text4', search: 'test4'}];
And i want to show the records in the array categories that are not in searchtag_catg array, using the id key...How can i do this?
Thx in advanced :)
Miguel
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Steve, amazing!
Worked like a charm.
Thx :)
Miguel