Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

How do you add a key to a variable map in react.js ? [duplicate]

How do you add a key to a variable map in react.js ? [duplicate]
 const props = [{
  count: 8
}, {
  count: 7
}, {
  count: 3
}]
const limit = props.map((x, index) => {
  return {
    count: Math.max(x.count, 0),
    key: `elementName${index}`
  }
})

console.log(limit)

9 0

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