can someone explain me, why does javascript return true? The array is global defined.
console.log(arr[j] + ">" + arr[j + 1]); // 8>50
console.log(arr[j] > arr[j + 1]); // true
This happens only for numbers<10, For Example does 22>10 return true.
I need it in my bubbleSort algorithm and fixed this with parseInt(arr[j])>parseInt(arr[j+1])
, but i think there will be better solutions.
Thanks a lot!:)