JSFiddle - React, Tailwind, and code Playground JavaScript var arr=[1,2,3] if(!arr.indexOf(1)){ // You value here alert("exists"); }