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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -