isSimpleValue

Returns true only if the value is a string, boolean, numeric, or date.

isSimpleValue(value) → returns boolean

Argument Reference

value any
Required

Examples
Sample code invoking the isSimpleValue function

isSimpleValue(42)

Expected Result: true

isSimpleValue("Hello world")

Expected Result: true

For engines that support null, such as Lucee and Railo, null is considered a complex value.

isSimpleValue( javaCast('null', '') )

Expected Result: false

isSimpleValue({})

Expected Result: false

isSimpleValue([])

Expected Result: false

As lists are just strings with delimiters, they are simple values.

isSimpleValue(arrayToList([]))

Expected Result: true

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub