# Step 9: Objects

Now for the final data type: objects. Like arrays, they can store multiple bits of information, except objects store the properties of something. For example, you might want to save the name, model and colour of a car. Or the name, time and location of a film playing at the cinema.

The syntax looks like this:

```javascript
{  property1: "value1",  property2: "value2",  property3: "value3" }
```

The names on the left ("property1") are known "keys". You can call them whatever you want, and any values can be given to them: strings, booleans, integers.

## Try it out <a href="#try-it-out" id="try-it-out"></a>

Let's define an object that represents a person:

```javascript
var person = {  
  firstName: "Virginia",  
  lastName: "Woolf",  
  occupation: "writer",  
  age: 59,  
  alive: false
};
```

We can of course `console.log()` the entire object, but you can also reference just one of the properties. Run this code:

```javascript
console.log(person.firstName);
```

{% hint style="info" %}

### Mini challenge <a href="#mini-challenge" id="mini-challenge"></a>

Using an object representing a person, `console.log()` a sentence introducing the person. Print out the following:

```javascript
"Hi, my name is {firstName} {lastName}. I am {age} years old, and work as a {occupation}."
```

Hint: you can construct a string by adding different strings and values together using the **concatenation** operator `+`. This includes the keys and values of objects. For example:

```javascript
var animal = {    
  species: "cat",     
  name: "Tabitha"
};

console.log("My " + animal.species + "is called " + animal.name + ".");
```

Don't forget, you might need to include spaces.
{% endhint %}
