Godot - Remove Values from the Beginning or End of an Array
GDScript code examples to remove values from the beginning or end of an array.
In GDScript, you can use pop_front()
to remove the value at the beginning of an array.pop_front()
directly modifies the specified array.
If the array is empty, no action is taken.
var array = ["apple", "lemon", "banana"]
array.pop_front()
print(array)
# ["lemon", "banana"]
In GDScript, you can use pop_back()
to remove the value at the end of an array.pop_back()
directly modifies the specified array.
If the array is empty, no action is taken.
var array = ["apple", "lemon", "banana"]
array.pop_back()
print(array)
# ["apple", "lemon"]
TitleGodot - Remove Values from the Beginning or End of an Array
CategoryGodot
Created
Update
AuthorYousuke.U