gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 00:42:33 27 4
gpt4 key购买 nike

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

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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com