Help me troubleshoot: Why aren't the results the same in IE9 and FF?
function TestArrayOperationsClick()
{
function sortNums(a, b)
{
return a - b;
}
var array = [6, 4, 2, 8];
console.log("Initial Array: " + array);
array.sort(sortNums);
console.log("Sorted Array: " + array);
array.push([1, 5, 10]);
console.log("Updated Array: " + array);
array.sort(sortNums);
console.log("Re-Sorted Array: " + array);
}
Expected Output:
LOG: Initial Array: 6,4,2,8
LOG: Sorted Array: 2,4,6,8
LOG: Updated Array: 2,4,6,8,1,5,10
LOG: Re-Sorted Array: 2,4,6,8,1,5,10 <- not sorted.