> For the complete documentation index, see [llms.txt](https://hemantajax-2.gitbook.io/es6-step-by-step/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hemantajax-2.gitbook.io/es6-step-by-step/object-enhancement.md).

# Object Enhancement

```javascript
var color = "red";
var speed = 10;
var drive= 'driveBMW';
fuction go(){}

var car = {color, speed, go, [drive]: function(){}}; // ES5 - {color: color, speed: speed}

console.log(car.color);
console.log(car.speed);
car.go();
car.driveBMW();
```

## Shorthand properties

```javascript
var firstname = "Hemant";
var lastname = "Singh";

var fullname = {firstname, lastname};

var prefix = 'Mr.';

var person = {prefix, fullname};
console.log(person);
```
