i am getting a strange result using arr.sort() below is the code
const arr=[1,99,102,121,2,2,3,7]
arr.sort()
console.log(arr)
I am getting the following output
[
1, 1000, 121, 2,
2, 3, 7, 99
]
can someone please explain what is happening and why?