Model Object
propertyIsPresent()
Signature
Section titled “Signature”propertyIsPresent() — returns boolean
Available in: model
Category: Miscellaneous Functions
Description
Section titled “Description”Returns true if the specified property exists on the model and is not a blank string.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | yes | — | Name of property to inspect. |
Examples
Section titled “Examples”// Get an object, set a value and then see if the property exists
employee = model("employee").new();
employee.firstName = "dude";
return employee.propertyIsPresent("firstName"); // Returns true
employee.firstName = "">
return employee.propertyIsPresent("firstName"); // Returns false