Spec-Zone.ru › ColdFusion

isBoolean

Returns true when a value can be converted to Boolean

isBoolean(value) → returns boolean

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: booleanFormat yesNoFormat

    Argument Reference

    value any
    Required

    Examples
    Sample code invoking the isBoolean function

    Yes

    Yes is considered a boolean that is true

    isBoolean("yes")

    Expected Result: YES

    No

    No is considered a boolean that is false

    isBoolean("no")

    Expected Result: YES

    Maybe

    Maybe is not considered a boolean

    isBoolean("maybe")

    Expected Result: NO

    True

    true is a boolean

    isBoolean(true)

    Expected Result: YES

    False

    false is a boolean

    isBoolean(false)

    Expected Result: YES

    Zero

    0 is considered a boolean that is false

    isBoolean(0)

    Expected Result: YES

    Non Zero Integer

    23 is considered a boolean that is true

    isBoolean(23)

    Expected Result: YES

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

    Spec-Zone.ru

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