Currently, I am working with an array that contains the following values:
var array1 = ['new_user', 'promotion']
My task is to filter out an object from OBJc based on this array1:
OBJc = [
{"id": 1, "array_": ['promotion', 'test1']},
{"id": 2, "array_": ['test444', 'test1']},
{"id": 3, "array_": ['new_user', 'test1']}
]
The requirement is to filter this JSON data based on whether "array_" contains any of the values in array1.
The desired output would be:
[
{"id": 1, "array_": ['promotion', 'test1']},
{"id": 3, "array_": ['new_user', 'test1']}
]