title: Javascript how to know if an array is subarray of another
body: <p>How could I do the following in javascript in efficient way?</p>
  
  <p>I've counter of 7 items(item0, item1, item2...item6) in order..
  like in counts = [0,2,0,5,6,0,9]; </p>
  
  <p>There are 3 mutually exclusive groups:
  group1: item0, item1, item2
  group2: item3, 4, 5
  group3: item6</p>
  
  <p>A group is considered selected if and only if counters of the group member elements are >= 0.</p>
  
  <p>Now I want to know which group is selected?</p>