diff options
author | Gilles Roudière <gilles.roudiere@gmail.com> | 2021-08-27 09:36:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 09:36:30 +0200 |
commit | 94e00216b478ac512f597d0c94fd77b9abf063a7 (patch) | |
tree | 549afefe2ab2b0ae73cc0e214c90fc22882deaa2 /doc | |
parent | c5f62fad90f6b324e8d05ec4a8342e69b8af5507 (diff) | |
parent | 60116b17b59c5e137924a9669ddc9bbe58a58ef7 (diff) |
Merge pull request #37209 from Calinou/add-array-pop-method
Add an `Array.pop_at()` method to pop an element at an arbitrary index
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Array.xml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 7767a1028d..df0e3a0459 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -393,6 +393,14 @@ <description> </description> </method> + <method name="pop_at"> + <return type="Variant" /> + <argument index="0" name="position" type="int" /> + <description> + Removes and returns the element of the array at index [code]position[/code]. If negative, [code]position[/code] is considered relative to the end of the array. Leaves the array untouched and returns [code]null[/code] if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty. + [b]Note:[/b] On large arrays, this method can be slower than [method pop_back] as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower [method pop_at] will be. + </description> + </method> <method name="pop_back"> <return type="Variant" /> <description> |