Count Occurrences

Pure
CountOccurrences

Counts how many times a value appears in an array.

Type: Pure (no side effects)
Category: Fortuna|Array & Collection
Keywords: array & collection

Inputs

NameTypeDefaultDescription
ArrayTArray<int>Array parameter
ValueintValue parameter

Outputs

NameTypeDescription
ReturnValueintReturnValue output

Example Use Cases

Example 1

Count how many of a specific item a player holds.

Example 2

Tally votes for a specific option.