Check if a value is in an Array in JavaScript


Given an array of strings, we want to know if a particular string value is in that array. Here we’ll use the Array object’s .indexOf function.

Software Environment

  • Any modern web browser

JavaScript Codes

Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert