Check that the array contains the given element.
vcc.inArray(array: any, element: any): boolean
Searches array for element and returns true if successful.
We look for the element within this array.
We look for this element within the array.
Returns true if the element is found in the array, false otherwise.
In most situations using vcc.isSelected is a good solution, but suppose that we have a list of postal codes and we have to look for the given one.
var allowedValues = ['2034', '2579', '1069', '5173']; vcc.alert(vcc.inArray(allowedValues, '1069') ? 'found' : 'not found'); vcc.alert(vcc.inArray(allowedValues, '2000') ? 'found' : 'not found');
Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.
There are no comments yet.