# JavaScript Overview – Property Syntax

JavaScript uses two types of syntax for defining property access. The following syntax should be followed for properties (with either type, the expression before or after the dot or square bracket is evaluated first):

- Dot notation:

      a.prop = 123;	// Adds a property

      b = a.prop;	// 123

                              delete a.prop;	// Removes the property

      c = a.prop;	// undefined

- Square brackets with a name and/or string:

      a ["break 1"] = 123	// Adds a property

      b = a["break 1"];	// 123

      nm = "break 1";	// Can use a variable

      c = a[nm];		// 123

                              delete a[nm]		// Removes the property