Preventing array from storing duplicate values
sosmongare opened this issue · 1 comments
sosmongare commented
On the todo app, How do I prevent an array from duplicating the etext i have just inserted
dammy001 commented
@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)