+ 3
Check to Array
I have a Array. If a word is in this Array already it will not add it to Array but If it is not in this Array, it will add it to Array How Can I Write It?
2 Réponses
+ 4
Use indexOf for checking
if (arr.indexOf (word) === -1) arr.push (word)
+ 1
Thank you 😊