Array Sort Javascript Complexity Gaming