alexa
Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

Transform an tab of key values into an array of key values in JS ?

Transform an tab of key values into an array of key values in JS ?

Add this and your problems will be solved

 .reduce(function(p,c){
    return {...p,...c};
},{}) 

Your code will look like this after adding the above code

 rates.map(rate => {
       return {
         [rate]: account.vent.filter(v => v.rate === rate)[0]
           ?.vat,
       }
     })
.reduce(function(p,c){
    return {...p,...c};
},{})

259 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online