In JavaScript, arrays are used to store collections of data. To verify if a particular value is present within an array, you can use the includes()
method. This method takes a single argument, which is the value you want to check for, and returns a boolean indicating whether or not the value is found in the array.
For example, the following code checks if the value “apple” is present in the array fruits
: