vuejs/v2.vuejs.org

Preventing array from storing duplicate values

sosmongare opened this issue · 1 comments

On the todo app, How do I prevent an array from duplicating the etext i have just inserted

@sosmongare you can just find the index of that value first using find or indexOf before updating the array

['m', 'I', 'j'].find(data => data === value)