How to check if a value exists in an array using Javascript or Jquery

Md Riyazuddin Verified
We will check for a value that exists in an array in 2 different ways using Javascript and jQuery.
const fruits = ["Banana", "Orange", "Apple", "Mango"];
$.inArray(value you wanted to search,  an array from where you want to search);


Leave a Comment