mode

This block is part of the number group and was last modified in core v10.4.28.

mode v10.4.28

In pins 1
  • numbers required
    array
Out pins 1
  • number
    number

Outputs the most frequently occurring number in the array pin; on a tie the value that appeared first in the array wins. Only actual numbers count : numeric strings and booleans are ignored : and an unwired, empty, or numberless array outputs nil. Example: [3,1,3,1] -> 3 (tie, 3 occurred first).

A typical wiring for mode: the number out pin feeds cast to value.

Studio canvas example for the mode block: typical wiring for mode.

Version history

Introduced in v10.4.28.


Back to number Return to the main group to view all sub-groups Back to parse Return to the group to view all blocks within this group