Cocos Creator API

1.4.x

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

array static

Module: js

Methods

removeAt
(
  • array
  • index
)

Removes the array item at the specified index.

name type description
array Any
index Number

fastRemoveAt
(
  • array
  • index
)

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

name type description
array Any
index Number

remove
(
  • array
  • value
)
Boolean

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

name type description
array Any
value Any

returns:

type: Boolean

fastRemove
(
  • array
  • value
)

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

name type description
array Any
value Number

verifyType
(
  • array
  • type
)
Boolean

Verify array's Type

name type description
array array
type Function

returns:

type: Boolean

removeArray
(
  • array
  • minusArr
)

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

name type description
array Array

Source Array

minusArr Array

minus Array

appendObjectsAt
(
  • array
  • addObjs
  • index
)
Array

Inserts some objects at index

name type description