array
Class
Index
Methods
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 TyperemoveArray
Removes from array all values in minusArr.appendObjectsAt
Inserts some objects at indexcontains
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
Methods
removeAt
Removes the array item at the specified index.
meta | description |
---|---|
Defined in | cocos2d/core/platform/js.js:703 |
Parameters
array
Anyindex
Number
fastRemoveAt
Removes the array item at the specified index. It's faster but the order of the array will be changed.
meta | description |
---|---|
Defined in | cocos2d/core/platform/js.js:713 |
Parameters
array
Anyindex
Number
remove
Removes the first occurrence of a specific object from the array.
meta | description |
---|---|
Returns | Boolean |
Defined in | cocos2d/core/platform/js.js:729 |
Parameters
array
Anyvalue
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.
meta | description |
---|---|
Defined in | cocos2d/core/platform/js.js:747 |
Parameters
array
Anyvalue
Number
verifyType
Verify array's Type
meta | description |
---|---|
Returns | Boolean |
Defined in | cocos2d/core/platform/js.js:762 |
Parameters
removeArray
Removes from array all values in minusArr. For each Value in minusArr, the first matching instance in array will be removed.
meta | description |
---|---|
Defined in | cocos2d/core/platform/js.js:781 |
Parameters
appendObjectsAt
Inserts some objects at index
meta | description |
---|---|
Returns | Array |
Defined in | cocos2d/core/platform/js.js:793 |
Parameters
contains
Determines whether the array contains a specific value.
meta | description |
---|---|
Returns | Boolean |
Defined in | cocos2d/core/platform/js.js:806 |
Parameters
array
Anyvalue
Any
copy
Copy an array's item to a new array (its performance is better than Array.slice)
meta | description |
---|---|
Returns | Array |
Defined in | cocos2d/core/platform/js.js:817 |
Parameters
array
Array