# Constant

have block scope like let keyword

```javascript
// ES5
var value = "hey";
value = "Cool";
console.log(value); // Cool

// ES6
const value = "hey";
value = "Cool";
console.log(value); // Error: "value" is read-only
```

## Another Example

```javascript
const obj = {};
obj.name = "Hemant";
console.log(obj); // {name: "Hemant"}

// but
const obj = {};
obj = {location: "HYD"};
console.log(obj); // Error: "obj" is read-only

obj.location = "BLR"; 
console.log(obj.location); // BLR

// If you really want to frreeze
const obj = Object.freeze(obj);
obj.location = "BLR"; 
console.log(obj.location); // still "HYD"
```

## Use Cases

```javascript
const API_KEY = "XXX";
const API_SECRET = "DDGD_DDDGG-SS";
const port = 4000;
const PI =3.14;
```
