let user = new Object(); // "object constructor" syntax
let user = {};  // "object literal" syntax

let user = {
  name: "John",
	"Full Name": "John Smith",
	// The last property in the list may end with a comma.
	// That is called a “trailing” or “hanging” comma.
  "age": 30,
};

user.isAdmin = true; // Extend object properties.
// To remove a property, we can use delete operator:
delete user.age;

// For multiword properties, the dot access doesn’t work.
user["Full Name"] = "New Value";
delete user["Full Name"];

let key = "age";
console.log(user[key]);
let fruit = "apple";
let bag = {
  [fruit]: 5, // the name of the property is taken from the variable fruit
	[fruit + 'Computers']: 5, // bag.appleComputers = 5
};
console.log(bag.apple); // 5

let bag = {};
bag[fruit] = 5; // Take property name from the fruit variable.
function makeUser(name, age) {
  return {
    name, // same as name: name
    age,   // same as age: age
  };
}

Property Checking

let myObject = {
	"myKey": null
};
if ("myKey" in myObject) {
	// Do something...
}
let obj = {
  test: undefined
};
console.log(obj.test); // It's undefined.
console.log("test" in obj); // true, the property does exist.

for…in Loop

for (userKey in user) {
  // Executes the body for each key among object properties
}

Comparison

Cloning & Merging