I’m looking for a way to verify against an array.
I’m lost in the array searching part.
I may get an array like this:
stream = ["apple","orange", "grape", "peach","strawberry","watermelon", "kiwi", "raspberry"];
But I only want :
selection = ["apple", "peach","strawberry","kiwi", "raspberry"];
How would I write a statement that would say:
If something in this stream matches my selection, do something.
You must use the inArray command like this:
InArray will search your array for the value you asked for and return its index. If the value isn’t present, it returns -1.