JSFiddle - React, Tailwind, and code Playground

JavaScript

var arr = [];
  arr.push([0,1]);
  arr.push([2,1]);
  arr.push([3,1]);
  arr.push([4,1]);
  arr.push([5,1]);

x=2;
y=1;
    var filtered = $(arr).filter(function(){
        thisX = this[0];
       thisY= this[1];
      return thisX==x && thisY==y; 
    });
    if(filtered.length > 0){
     alert("yes"); 
    }
else {
alert("no");
}