Thuta Learning
JavaScript
IntermediateProgrammingbeginner

JS Objects

Objects are variables that group data together using key: value pairs.

javascript
const person = {
  firstName: "Aung",
  lastName: "Hla",
  age: 30,
  fullName: function() {
    return this.firstName + " " + this.lastName;
  }
};

console.log(person.firstName);
console.log(person.fullName());
You should see
Aung Aung Hla