actionscript-3 - ActionScript 3 : Check an array for a match

标签 actionscript-3 arrays match

如果您有一个包含六个数字的数组,请说:

public var check:Array = new Array[10,12,5,11,9,4];

或者
public var check:Array = new Array[10,10,5,11,9,4];

你如何检查匹配(一对?)

最佳答案

Array类(class)有一个 indexOf method :

function indexOf(searchElement:*, fromIndex:int = 0):int

Searches for an item in an array by using strict equality (===) and returns the index position of the item.

Parameters

  • searchElement:* — The item to find in the array.
  • fromIndex:int (default = 0) — The location in the array from which to start searching for the item.

Returns

  • int — A zero-based index position of the item in the array. If the searchElement argument is not found, the return value is -1.

关于actionscript-3 - ActionScript 3 : Check an array for a match,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2046364/

相关文章:

php - JavaScript 与 PHP,通过 URL(post)操作 XML 值(元素的文本)

asp.net-mvc - 烦人的错误 #2048 : Security sandbox violation from localhost

algorithm - 切出一个矩形

javascript - 交换 2D 数组的 2 个元素

javascript - 使用ExternalInterface和IE从JavaScript获取Flash中的当前URL

php - 如何在PHP中分别求和二维数组的值

arrays - Swift:在可选上使用 .sorted 时,对成员 '+' 的引用不明确

r - 分组匹配

python - python 中的正则表达式从文件读取文本

dataframe - KDB+ 如何检查所有列是否具有相同的符号?