.contains - macmcmeans/localDataStorage GitHub Wiki

localDataStorage.contains( arrayKeyName, value )

This checks all elements of arrayKeyName, an Array Key, for the existence of value and, if found, returns true. If value is not contained in the array, false is returned. The data type of value must match.

EXAMPLE:

🔹 Existing Array Key called 'cars' having value ['Ford', Chrysler', 'Nissan', 'BMW', 'Peugot', 'Saab', 'Citroën']:

Check for a Saab: ● localData.contains( 'cars', 'Saab' ); --> true

📝 NOTE: This method is specific to Array Keys and will fail if used on any other key type. This method is related to where. If Array Keys are not involved, this is also similar to hasval (which checks the entire store). Array Keys use one-based array indices.