When I use the .sort() method on my firstArr example, it functions correctly. However, when I apply the .sort() method to secondArr, which contains values exceeding 1000, it malfunctions. I have attempted to locate information on any limitations of the .sort() method, but my search has been unsuccessful. Any insights would be greatly appreciated. Thank you.
var firstArr = [ 1 , 10, 5, 15];
firstArr.sort(); // [1, 5, 10, 15];
var secondArr = [1000, 500, 999, 150];
secondArr.sort(); //[1000, 150, 500, 999];