toBool

Converts an argument value into a boolean value, depending on its type.

  • From string: try to convert the string value as a boolean, from “true” if the string value is “true”, false otherwise
  • From numerical: true if the numerical value is not equal to 0, false otherwise

Category

Conversion

Function syntax

toBool(<parameter>)

Parameters

  • decimal
  • boolean
  • string
  • integer

Signatures and returned types

toBool(<decimal>)

toBool(<boolean>)

toBool(<string>)

toBool(<integer>)

Return a boolean.

Examples

toBool("true")

toBool(1)

Returns true.

toBool("this is not a boolean")

Returns false.

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now