Spec-Zone.ru › ColdFusion

isSimpleValue

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

isSimpleValue(value) → returns boolean

  • CF3+
  • Lucee
  • BL 1.0.0+
  • See Also: isArray isStruct

    Argument Reference

    value any
    Required

    Examples
    Sample code invoking the isSimpleValue function

    A number is a simple value

    isSimpleValue(42)

    Expected Result: true

    A string is a simple value

    isSimpleValue("Hello world")

    Expected Result: true

    Null is a complex value

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

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

    Expected Result: false

    A structure is a complex value

    isSimpleValue({})

    Expected Result: false

    An array is a complex value

    isSimpleValue([])

    Expected Result: false

    A list is a simple value

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

    isSimpleValue(arrayToList([]))

    Expected Result: true

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/issimplevalue

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API