Array Sort Javascript Complexity Theory