๐—๐—ฎ๐˜ƒ๐—ฎ๐—ฆ๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜ ๐—ข๐—ฏ๐—ท๐—ฒ๐—ฐ๐˜๐˜€ ๐—”๐—ป๐—ฑ ๐— ๐—ฒ๐˜๐—ต๐—ผ๐—ฑ๐˜€ ๐—˜๐˜…๐—ฝ๐—น๐—ฎ๐—ถ๐—ป๐—ฒ๐—ฑ

A JavaScript object is a bag of named values. Use it to model the real world. Think of a car, a user, or a coffee machine.

Read properties with dot notation or brackets.

A method is a function inside an object. The this keyword points to the object you called.

Avoid arrow functions for methods. Arrow functions do not have their own this. They take it from the outside. Use regular functions instead.

Use constructor functions to make many objects. The new keyword does a few things. It creates an empty object. It sets the properties. It returns the final object.

Put objects inside other objects for complex data. Use the optional chaining operator ?. to stop your code from crashing when a property is missing.

Use these static helpers for objects.

Watch for these traps.

Build a playlist or a shopping cart to practice. Model nouns and verbs. Break things to see how they work.

Source: https://dev.to/ilyas_elaissi/javascript-objects-methods-explained-with-examples-56cg