Sort Array Key Value Javascript Substring