Actionscript 3: Check an array for a match -
if have array 6 numbers, say:
public var check:array = new array[10,12,5,11,9,4];   or
public var check:array = new array[10,10,5,11,9,4];   how check match (of pair?)
array class has indexof method:
function indexof(searchelement:*, fromindex:int = 0):intsearches item in array using strict equality (===) , returns index position of item.
parameters
searchelement:*— item find in array.fromindex:int(default = 0) — location in array start searching item.returns
- int — zero-based index position of item in array. if
 searchelementargument not found, return value -1.
Comments
Post a Comment