- JS Introduction
 - JS Introduction
 - JS Comments
 - JS Variables
 - JS Datatypes
 - JS Operators
 - JS Type Conversions
 - JS Control Flow
 - JS Comparisons
 - JS If else
 - JS If else Ladder
 - JS Ternary Operator
 - JS Switch
 - JS For Loop
 - JS For In
 - JS For Of
 - JS While
 - JS Do While
 - JS Break & Continue
 - JS Functions
 - JS Function Declaration
 - JS Function Parameters
 - JS Return Statement
 - JS Function Expressions
 - JS Anonymous Functions
 - JS Objects
 - JS Objects
 - JS Object Methods
 - JS Object Constructors
 - JS Object Destructuring
 - JS Object Prototypes
 - JS Map, Filter & Reduce
 - JS ES6
 - JS ES6
 - JS let and const
 - JS Arrow Functions
 - JS Template Literals
 - Destructuring Assignment
 - JS Spread Operator
 - JS Default Parameters
 - JS Classes
 - JS Inheritance
 - JS Map
 - JS Set
 - JS Async
 - JS Callbacks
 - JS Asynchronous
 - JS Promises
 - JS Async/Await
 - JS HTML DOM/BOM
 - JS Document Object
 - JS getElementbyId
 - getElementsByClassName
 - JS getElementsByName
 - getElementsByTagName
 - JS innerHTML
 - JS outerHTML
 - JS Window Object
 - JS History Object
 - JS Navigator Object
 - JS Screen Object
 
JavaScript Objects
- Objects in JavaScript are containers for named values, called properties, and methods (functions).
 - Properties and methods are accessed using dot notation (object.property) or bracket notation (object['property']).
 
Syntax:
// Object Literal Syntax
const person = {
  firstName: 'John',
  lastName: 'Doe',
  age: 30,
  greet: function() {
    console.log('Hello!');
  }
};
- firstName, lastName, age: Properties of the object.
 - greet: A method (function) within the object.
 
Why it is Used:
- Data Organization: Objects help organize and structure data by grouping related information.
 - Code Reusability: Methods within objects allow for the encapsulation of functionality for reuse.
 - Real-world Representation: Objects can model real-world entities and their interactions.
 
Accessing Properties and Methods:
// Accessing Properties and Calling a Method
console.log(person.firstName); // Output: John
console.log(person['lastName']); // Output: Doe
person.greet(); // Output: Hello!
Adding and Modifying Properties:
// Adding a New Property
person.gender = 'Male';
// Modifying an Existing Property
person.age = 31;
Object Methods:
// Method to Display Full Name
person.fullName = function() {
  return this.firstName + ' ' + this.lastName;
};
console.log(person.fullName()); // Output: John Doe
Object Constructor:
// Object Constructor Function
function Car(make, model, year) {
  this.make = make;
  this.model = model;
  this.year = year;
}
// Creating Instances of the Car Object
const car1 = new Car('Toyota', 'Camry', 2022);
const car2 = new Car('Honda', 'Accord', 2021);
Object Destructuring:
// Object Destructuring
const { firstName, lastName, age } = person;
console.log(firstName, lastName, age); // Output: John Doe 31
Summary
- Objects in JavaScript are used to store and organize data using key-value pairs.
 - They can represent real-world entities, have properties and methods.
 - Objects provide a way to structure and group related information for better code organization.
 - Object properties can be accessed using dot notation or bracket notation.
 - Object methods are functions stored within objects.
 - Objects can be created using literal syntax, constructors, or destructuring.