Pushing Podio
Search
🔑

Object Keys

Working with object is the same as in JavaScript.

For example, given an object like:

{
	name:"John",
	DOB:"1945-12-31",
	user-status: "Active",
	parent: NULL
}

You can access these values with dot-notation if, and only if, the key is all lower-case and starts with a-z and only consists of a-z and 0-9.

In the above example, only the keys “name” and “parent” can be accessed in dot-nation.

For example:

print object.name
print object.parent

You cannot address the other keys with dot-notation. You must use array notation.

For example:

print object["DOB"]
print object["user-status"]

You could use array notation to access ALL keys in the object or array.

The only reason to use dot-notation is to make code easier to read.

(c) 2024 Globi Web Solutions | Join the Discussion in our Podio Workspace.

x