Prism · Sugar

$count

Counts the elements of a list. Shorthand for a $reduce that adds one for each.

The source
{
  items: ['apple', 'banana', 'cherry', 'date', 'elderberry'],
}
The config
{ $count: { over: { $ref: '$.items' } } }
What comes out
5
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.