I have this code below :
function myFunction(){
let events_array = [];
events_array[0] = [ 'vahsonqmvl80jligsncdb7amk0@google.com', 'Oregon IRC', '6/1/2022','Old' ];
events_array[1] = [ 'vahsonqmvl80jligsncdb7amk0@google.com', 'Oregon IRC', '6/1/2023','Old' ];
events_array[2] = [ 'vahsonqmvl80jligsncdb7amk0@google.com', 'Oregon IRC', '6/1/2024','Old' ];
new_element = [ 'vahsonqmvl80jligsncdb7amk0@google.com', 'Oregon IRC', '6/1/2023','Old' ];
if(new_element in events_array){
console.log('Exist');
}else{
console.log('Does not exist');
}
}
I want to identify if the array new_element
is in the array new_events
. Is there a fast way to do it without looping manually like 'not in'? The general for loop is very slow it causes my code to exceed the maximum execution time. I tried the code above but it always say 'does not exist'. Please help. Thanks!