.where - macmcmeans/localDataStorage GitHub Wiki

localDataStorage.where( arrayKeyName, value )

This checks all elements of arrayKeyName, an Array Key, for the existence of value and, if found, returns the ordinal position in the array where value was found. The data type of value must match.

EXAMPLE:

🔹 Existing Array Key called 'course' having value [{'book':'math'}, {'book':'english'}, {'book':'science'}]:

Check for a certain book: ● localData.where( 'course', {'book':'english'} ); --> 2

📝 NOTE: This method is specific to Array Keys and will fail if used on any other key type. This method is related to contains. Array Keys use one-based array indices.