1 < [6] how does this comparison compare in a JavaScript environment?

binary sorting method of arrays:
function quickSort (arr) {

            if (!Array.isArray(arr) || arr.length == 0) {
                return [];
            };
            var cIndex = Math.floor(arr.length / 2),
                c = arr.splice(cIndex,1),
                l = [],
                r = [];
            for (var i = 0; i < arr.length; iPP) {
                if (arr[i] < c) {
                    l.push(arr[i]);
                } else{
                    r.push(arr[i]);
                };
            };
            return quickSort(l).concat(c,quickSort(r));
        };
The comparison of arr [I] < c in

is actually similar to the question I asked. How does a number compare with an array?

Jul.17,2022

I don't understand what you want to ask. Arr [I] represents the element c in the subscript I of the convenience array. C represents the returned field deleted or added by arr


C is not an array


refer to https://www.cnblogs.com/Juphy...

1truefalse10
2
3null0.
4undefinedNaN
5:
     10
     20
     30
     4NaN
6valueOf()NaNtoString()
The elements of the

Array.valueOf array are converted to strings separated by commas and concatenated together. Its operation is the same as the Array.toString and Array.join methods.

[6] = > '6' = > 6
so 1 < [6] = true


https://developer.mozilla.org...
https://developer.mozilla.org...
compared to tutorials written by others, I recommend you to see mdn

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c0fb99-32c98.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c0fb99-32c98.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?