I’ve been using CFML for over 20 years, but I only just learned about min and max, thought i’d share!
min(1,5) // returns 1
max(1,5) // returns 5
I’ve been using CFML for over 20 years, but I only just learned about min and max, thought i’d share!
min(1,5) // returns 1
max(1,5) // returns 5
IMO these functions should be enhanced to accept any Comparable type, e.g. Dates, Strings, etc.
What about accepting more than two numbers, or a query column?
That’s already fairly easy with numbers.
dump( [ 8, 2, 4 ].Min() );// 2
q = Query( col1: [ 8, 2, 4 ] );
dump( q.ColumnData( "col1" ).Max() );// 8