Skip to content

String to Boolean conventions

Damiano Di Vincenzo edited this page Jun 5, 2020 · 2 revisions

To pass a boolean value through a string you can use one of the following case-insensitive values.

Boolean String equivalent
true 'true', 't', '1', true
false 'false', 'f', '0', false
null 'null', null
undefined 'undefined', undefined

NB: null and undefined are not always admitted. If they are invalid values for the current context, they will be transformed to a default value specified in the documentation.

Clone this wiki locally