exploring the nuances of array.sort method