I've got an array that could have 4 digits elements or less (from html select)
for example some possible variants of myArray
:
myArray = ['1']
myArray = ['4']
myArray = ['2', '3']
myArray = ['1', '2', '3', '4']
etc...
now I've got an object that has possible variants of myArray
for example some possible variants of myObject
:
myObject = [
{active: false, forArrays:['2','4']},
{active: false, forArrays:['2,3,4','2,4']},
{active: false, forArrays:['2','1,4']},
{active: false, forArrays:['2']},
]
I want to change active to true if myArray
is exact the same that one of the forArrays
variants.
How can I do that? Should I keep forArrays
an array as it is or should it be changed to an object to make this problem easier to solve?