From the course: JavaScript Essential Training

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Object properties

Object properties

- [Instructor] Properties are literally the properties of the object. They describe different aspects of the object. Object properties are defined using a colon separated name value pair, where the name can be any string and is placed on the left. And the value can be any string inside quotation marks or an integer or a floating point number or a Boolean value as a true or false or an array, or even another object, placed on the right. You control the property names. And in JS the standard states, a property name can only contain letters, digits, dollar signs, and underscores. If you add quotation marks or hyphens or other symbols the object will not function properly and JavaScript will crash because there'll be incorrect code inside the object definition. The rule of thumb here to make sure everything works properly is to simply use camel case for property names.

Contents