Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
How to avoid adding an object to an array multiple times in JavaScript?
Hope you guys can help me
1 Resposta
0
In any language, you can just check if the array already contains the object, like:
if <Object> not in <Array>:
<Add object>