Godot - Count occurrences of value in array
GDScript code example to count occurrences of specified value in array.
Can get count of occurrences of specified value in array using count()
in GDScript.
Returns "0" if specified value does not exist.
var array = ["apple", "lemon", "apple", "banana"]
var count = array.count("apple")
print(count)
# 2