How to find out the index of a particular field value from an array of object

                        let a = resultArrayDiscount.findIndex(item => item["Item Category List"].value === resultArrayItem[i]["Item   
                                        Category"]["value"]);
                        let discount = 0;
                        let discountCodePercentage = ''
                        if (a >= 0) {
                            discountCodePercentage = resultArrayDiscount[a]['Discount Percentage']['value'];        
                        }

Leave a comment

Your email address will not be published. Required fields are marked *