JavaScript is in array [duplicate] June 6, 2023 by Tarik Try this: if(blockedTile.indexOf("118") != -1) { // element found }