Add uniqui item to the array

mohsinalisoomro

MOHSIN ALI SOOMRO

Posted on July 7, 2021

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
💖 💪 🙅 🚩
mohsinalisoomro
MOHSIN ALI SOOMRO

Posted on July 7, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024