The title should explain my question.
I have an array:
a = [[1,2],[1,3],[1,4]];
How can I check if the array [1,2] is inside the array a?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That depends on the situation.
given
We can check easily if
aresides inc, if we havecto test on.or even simpler for browser that supports it (ie7 doesn’t)
But if we only have
a, andais not a local variable and we wish to know if it exists inside any array, then we can’t, sinceais a reference to an object and we can’t possibly know if a reference to it exists elsewhere outside our current scope.