what I am really trying to do is add an array after an event only if that event occurred once like the press of the enter button. if the user keeps on entering the wrong answer it should only update the array once with the array that represents the question. if you can help me out with this question that deals with more of what i am trying to do would be great.
if you cant help me with that i am wondering how to insert an array after an event only if the array isn't in the array. can you show me some code where you search for an array inside of an array and if that array is inside do something or nothing?
I don't understand why in the below code i am not able to search for arrays
function onlyUnique(value, index ,self){
return self.indexOf(value) === index;
}
var a = ['a' , [1], [1],'a']
var unique = a.filter(onlyUnique)
console.log(unique)