DEV Community

MOHSIN ALI SOOMRO
MOHSIN ALI SOOMRO

Posted on

1 1

Add uniqui item to the array

code

const handleQualityChange=(e)=>{
    if(quality.find((i:any)=>i===e.target.value)){
      const index = quality.indexOf(e.target.value)
      quality.splice(index,1)
      console.log({quality})
    }else{
      quality.push(e.target.value)
      console.log({quality})
    }
  }```

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay