I need to check if an object has same id on DOM, because i am trying to create a modal window library,
the problem is in browsers console when i write
$("#anonexistingid");
it returns []
but in my code
if($("#"+id)!==[]){
return;
}
just does not work. What is the proper way of defining an empty array?(Because i think [] means empty array, maybe not i am not sure :D)
JQuery always returns an object. you can check it’s length to see if it’s empty or not: