property
Property access in Soul allows you to retrieve and modify properties of objects using dot notation. This is fundamental for working with objects, classes, and complex data structures.Basic Property Access
Access object properties using dot notation:Property Assignment
Modify object properties using dot notation:Nested Property Access
Access properties of nested objects:Property Access vs Bracket Notation
Compare dot notation with bracket notation:Dynamic Property Access
Access properties using variables:Property Access on Class Instances
Access properties of class instances:Property Access with Methods
Access and call methods as properties:Safe Property Access
Handle property access safely:Property Existence Checking
Check if properties exist:Property Enumeration
Iterate through object properties:Property Validation
Validate property values:Property Copying
Copy properties between objects:Property Defaults
Provide default values for properties:Property Transformation
Transform property values:Property Access in Loops
Access properties within loops:Property Access with Error Handling
Handle property access errors:Property Access Patterns
Common patterns for property access:Best Practices
- Use dot notation when possible: It’s more readable than bracket notation
- Validate objects: Check for null before accessing properties
- Handle missing properties: Provide defaults or error handling
- Use meaningful property names: Make property purpose clear
- Avoid deep nesting: Keep object structures reasonably flat