Skip to content

Model Object

propertyIsPresent()

propertyIsPresent() — returns boolean

Available in: model Category: Miscellaneous Functions

Returns true if the specified property exists on the model and is not a blank string.

NameTypeRequiredDefaultDescription
propertystringyesName of property to inspect.
// 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