From the course: JavaScript Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Object properties

Object properties - JavaScript Tutorial

From the course: JavaScript Essential Training

Start my 1-month free trial

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