0

Just wondering, what is the best way to go about "sorting" an array to the following:

I have the array as [1,1,1,1,2,2,2,2], how would I sort it so it goes:

[1,2,1,2,1,2,1,2]

I cannot think of the phrase or a method to do this.

This is done in angularjs/can use jquery.

Tyler Wilson
  • 41
  • 1
  • 5

0 Answers0