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):int

searches 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 searchelement argument not found, return value -1.

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -