indexOf
Look for an item in a DefineList.
list.indexOf(item)
indexOf
finds the position of a given item in the DefineList.
var list = new DefineList(['Alice', 'Bob', 'Eve']);
list.indexOf('Alice'); // 0
list.indexOf('Charlie'); // -1
Parameters
- item
{*}
:The item to find.
Returns
{Number}
:
The position of the item in the DefineList, or -1 if the item is not found.