Search This Blog

Friday, September 9, 2022

copying the existing array and forming the new array by adding the values in javascript

  

           

let newrrraylist = this.message.text.shipToParty;

this.message.text.shipToParty = [];

            newrrraylist.forEach((element) =>
            {
              debugger;
                let items = {};

                items['dealer'] =   element.dealer?.replace(/\d/g, '').replace(/,/g, '');

                items['dealerId'] =   element.dealer?.match(/(\d+)/)[0];

                items['quantity'] = element.quantity;

                items['deliverypoint'] = element.deliverypoint;

                items['subdealer'] = element.subdealer?.replace(/\d/g, '').replace(/,/g, '');

                items['subdealerId'] =   element.subdealer?.match(/(\d+)/)[0];

                this.message.text.shipToParty.push(items);
               

            })
            console.log("newarray", this.message.text.shipToParty)
           
     
        });

No comments:

Post a Comment

Validating to select in sequencial order using angular

    < input type = "checkbox" (change) = "handleSelectTaskItem($event, taskItem)" [checked] = " taskItem . i...