array 类型

模块: js父模块: js

索引

方法
  • removeAt Removes the array item at the specified index.
  • fastRemoveAt Removes the array item at the specified index….
  • remove Removes the first occurrence of a specific object from the array.
  • fastRemove Removes the first occurrence of a specific object from the array….
  • verifyType Verify array's Type
  • removeArray Removes from array all values in minusArr. For each Value in minusArr, the first matching instance in array will be removed.
  • appendObjectsAt Inserts some objects at index
  • indexOf Exact same function as Array.prototype.indexOf….
  • contains Determines whether the array contains a specific value.
  • copy Copy an array's item to a new array (its performance is better than Array.slice)

Details

方法

removeAt

Removes the array item at the specified index.

metadescription
定义于cocos2d/core/platform/js.js:688
参数列表
fastRemoveAt

Removes the array item at the specified index.It's faster but the order of the array will be changed.

metadescription
定义于cocos2d/core/platform/js.js:698
参数列表
remove

Removes the first occurrence of a specific object from the array.

metadescription
返回Boolean
定义于cocos2d/core/platform/js.js:714
参数列表
  • array Any
  • value Any
fastRemove

Removes the first occurrence of a specific object from the array.It's faster but the order of the array will be changed.

metadescription
定义于cocos2d/core/platform/js.js:732
参数列表
verifyType

Verify array's Type

metadescription
返回Boolean
定义于cocos2d/core/platform/js.js:747
参数列表
removeArray

Removes from array all values in minusArr. For each Value in minusArr, the first matching instance in array will be removed.

metadescription
定义于cocos2d/core/platform/js.js:766
参数列表
  • array Array Source Array
  • minusArr Array minus Array
appendObjectsAt

Inserts some objects at index

metadescription
返回Array
定义于cocos2d/core/platform/js.js:778
参数列表
indexOf

Exact same function as Array.prototype.indexOf.HACK: ugliy hack for Baidu mobile browser compatibility, stupid Baidu guys modify Array.prototype.indexOf for all pages loaded, their version changes strict comparison to non-strict comparison, it also ignores the second parameter of the original API, and this will cause event handler enter infinite loop.Baidu developers, if you ever see this documentation, here is the standard: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf, Seriously!

metadescription
返回Number
定义于cocos2d/core/platform/js.js:791
参数列表
  • searchElement Any Element to locate in the array.
  • fromIndex Number The index to start the search at
contains

Determines whether the array contains a specific value.

metadescription
返回Boolean
定义于cocos2d/core/platform/js.js:803
参数列表
  • array Any
  • value Any
copy

Copy an array's item to a new array (its performance is better than Array.slice)

metadescription
返回Array
定义于cocos2d/core/platform/js.js:814
参数列表