SOURCE

/**
 * @param {number[]} nums1
 * @param {number[]} nums2
 * @return {number}
 */
var findMedianSortedArrays = function(nums1, nums2) {
    let nums3 = nums1.concat(nums2).sort((a, b) => a - b)
    let totalLen = nums1.length + nums2.length
    let halfIndex = parseInt(totalLen / 2)
console.log("#####", nums3, halfIndex)

    return totalLen % 2 > 0 ? nums3[halfIndex] : (nums3[halfIndex] + nums3[halfIndex - 1]) / 2
};

console.log("#####", findMedianSortedArrays([1,2,3,4,5], [6,7,8,9,10,11,12,13,14,15,16,17]))
console 命令行工具 X clear

                    
>
console