Files
n8n-docs/docs/data/expression-reference/boolean.md
Kartik Balasubramanian 96e6ba167d Revamp the data section of n8n docs (#4077)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-02-25 14:30:33 +00:00

72 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Boolean
## _`Boolean`_.**`isEmpty()`**
**Description:** Returns <code>false</code> for all booleans. Returns <code>true</code> for <code>null</code>.
**Syntax:** _`Boolean`_.isEmpty()
**Returns:** Boolean
**Source:** Custom n8n functionality
**Examples:**
```javascript
// bool = true
bool.isEmpty() // => false
```
```javascript
// bool = false
bool.isEmpty() // => false
```
```javascript
// bool = null
bool.isEmpty() // => true
```
## _`Boolean`_.**`toNumber()`**
**Description:** Converts <code>true</code> to 1 and <code>false</code> to 0
**Syntax:** _`Boolean`_.toNumber()
**Returns:** Number
**Source:** Custom n8n functionality
**Examples:**
```javascript
true.toNumber() //=> 1
```
```javascript
false.toNumber() //=> 0
```
## _`Boolean`_.**`toString()`**
**Description:** Converts <code>true</code> to the string true and <code>false</code> to the string false
**Syntax:** _`Boolean`_.toString()
**Returns:** String
**Source:** JavaScript function
**Examples:**
```javascript
// bool = true
bool.toString() //=> 'true'
```
```javascript
// bool = false
bool.toString() //=> 'false'
```