exists

Modified on Mon, 04 Sep 2023

Description

Use this function to check if a value is present, meaning it is not undefined and not an empty string.

Syntax

exists(value)

Returns

Return ValueDescription
Boolean
Returns 'true' if the value is present (not undefined and not an empty string); otherwise, 'false'.

Sample

ExampleResultDescription
exists('Hello, World!')trueReturns 'true' because the value is present and not empty.
exists('')falseReturns 'false' because the value is an empty string.
exists(undefined)falseReturns 'false' because the value is undefined.

To view all String Functions, click here.

See Also

get