1

I have two array.
a_array= [2,3,4]
b_array= [2,3,4,5]

I'd like to know how to check all of a_array elements are included in b_array.
I used Jquery. $.inArray( a_array, b_array ) but It can only be checked for one element.

6
  • What is in_Array? There's no native function called that in JavaScript. Commented Jul 22, 2014 at 9:41
  • @Andy Perhaps the OP is using jQuery. Commented Jul 22, 2014 at 9:43
  • Ah. sorry, yeah. I used jQuery Commented Jul 22, 2014 at 9:47
  • _.intersection(a_array, b_array); underscorejs.org/#intersection Commented Jul 22, 2014 at 9:48
  • Oh! Duplicated question. Sorry for that. Actually I find out first, before I ask. But didn't see anything. May be I search with the wrong key word. Thank you all. Commented Jul 22, 2014 at 10:03

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.