Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
How to avoid adding an object to an array multiple times in JavaScript?
Hope you guys can help me
1 Antwort
0
In any language, you can just check if the array already contains the object, like:
if <Object> not in <Array>:
<Add object>