628. Maximum Product of Three Numbers Javascript

It Work Perfectly For TestCases But Doesnot Work For Other Cases like Big Cases
throw RunTime Errorimage

var maximumProduct = function(nums) {
    var product = []
    for (let i = 0 ; i < nums.length;i++){
        for (let j = 0 ; j < nums.length;j++){
            if (j != i){
                for (let h = 0 ; h < nums.length;h++){
                    if (h != j && h != i){
                        var pro = nums[i]*nums[j]*nums[h]
                        product.push(pro)
                    }
                }
            }
        }
    }
    return Math.max(...product)
};
Comments (1)