forEach Method

Call a function for each property of this Entity.

forEach(func: PropertyHandler, includeCustom: booleantrue): void

@note Custom-handled properties are core properties that have behavior enforced by C++ handlers.

@throws Error if metadata for the class cannot be retrieved.

@example

entity.forEach((name, property) => {
  console.log(`Property name: ${name}, Property type: ${property.propertyType}`);
});
Parameter Type Description
func PropertyHandler The callback to be invoked on each property.
includeCustom boolean If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.

Returns - void

Defined in

Last Updated: 03 April, 2025