How to Do .where Equals Anything

I use .where() a lot to select lists of things - contacts for example.

Often I am saying something like:

repeat contacts.data.where('age_range', input_age_range.value, "==")

So this will show me the contacts in the age range selected by input_age_range.

However, if input_age_range has nothing selected, then I want to show contacts of all age ranges… but that doesn’t work this .where type of function.

Is there an easy way around what I am looking to do…?

Best wishes,
Antony.

Community Page
Last updated: