# Understanding Objects in JavaScript .

## Objects :-

Objects are pre defined data structure in JavaScript which is used to store the in the form of as a collection of key-value pair & methods in JavaScript . It is fundamental for storing data of real world entities .

The most common way to create an Object .

```javascript
const object={
    name:"Chirag",
    age:18,
    favSport:"Cricket"
    greet:()=>{
        console.log("${this.name} loves  to play            ${this.favSport}")
    }    
}
```

*   **Accessing Properties** : We can access its properties easily using [object.name](http://object.name) or object\["name"\] .
    
*   **Editing** : Also we can edit it's properties using the object.name="Chirag Purohit" .
    
*   D**eleting :** We also delete it properties using the delete [object.name](http://object.name)
    
*   Applying Loop Over the Object to access each property
    
    *   ```javascript
        const user={
            name:"dalla",
            age:40,
            profession:"Math's teacher"
        }
        for(let key in user){
            console.log(`${key}:${user[key]} `);
        }
        ```
