Edge Cases Quick Reference

Return Values on Empty or Missing Data

Function Condition Returns
First(arr) Empty array null
Last(arr) Empty array null
IndexOf(arr, val) Not found -1
WhereByField(...) No matches [] (empty array)
FindByField(...) No match null
Find(arr, fn) No match null
AnyByField(...) Empty array false
AllByField(...) Empty array true (vacuous truth)
Any(arr, fn) Empty array false
All(arr, fn) Empty array true (vacuous truth)
Select(...) Empty array []
SelectMany(...) Empty array []
Project(...) Empty array []
Omit(...) Empty array []
Merge(arr) Empty array {}
Min(arr) No numbers null
Max(arr) No numbers null
Average(arr) No numbers null
Median(arr) No numbers null
Mode(arr) No numbers null
Sum(arr) No numbers 0
ToNumber(s) Invalid string null
RegexMatch(...) No match null
RegexMatchAll(...) No matches []
RegexMatchDetail(...) No match null
RandomChoice(arr) Empty array null

Case Sensitivity

  • String comparisons (==, !=, <, >) are case-sensitive
  • Contains, StartsWith, EndsWith are case-sensitive
  • Query function comparisons are case-sensitive
  • Use ToLower() or ToUpper() for case-insensitive matching

Sort Order for Mixed Types

Sort groups elements by type, then sorts within each group:

  1. null values (first)
  2. Numbers (ascending)
  3. Strings (lexicographic)
  4. Booleans (false before true)

Split Preserves Empty Strings

The Split function preserves empty strings produced by adjacent or leading/trailing delimiters:

Split("a,,b", ",")        # ["a", "", "b"]
Split(",a,b,", ",")       # ["", "a", "b", ""]

Back to top

Copyright © Mesch Systems 2025-2026. All rights reserved.