0

I have two arrays. And I use filter() to compare and bring me the value that is equal in both.

$(array1).filter(array2);

In the console the value appears like that: http://prntscr.com/bkqkd7.

How do I get the value, the string from that object. What does it mean the "0" in the console?

1
  • 0 is the first element of the array. Also you can see the length is 1. So it is an array and its elements being displayed. Commented Jun 25, 2016 at 3:33

1 Answer 1

1

Check it as an Array and loop through it:

for (var i=0; i<$(array1).filter(array2).length; ++i)
Sign up to request clarification or add additional context in comments.

1 Comment

Great! thats It. I come up with the same solution but yours is better written. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.