Am having following array:`arrtooth`

```
var arrtooth = tooth.split('|');

```

It gets value 

```
arrtooth=[1,2,3,6,7,10,11,15,16,17];

```

I want the elements which are in sequence `(1,2,3) (6,7) (10,11) (15,16,17)`.
separately.My code is in Jquery.I just want the actual logic.

If i get the output as 3 2 2 3 in an array it will be fine or if you have any thing (output) which can elaborate the sequence will be ok.