Objects in JavaScript
Objects are one of the most important things in JavaScript. Think of them like real-world objects: a phone has a color, brand, and size. In code, we can describe anything the same way!
An object is a collection of properties – each property has a name (key) and a value. Let’s learn step by step with simple examples you can try right now.
How to Create an Object
Use curly braces {} and write key-value pairs separated by commas. Keys are usually strings, values can be anything!
See how the console shows all the properties? Cool! 🎉
Getting Values from an Object
There are two ways: dot notation (.) or bracket notation []. Dot is easier when you know the key name.
Adding or Changing Properties
Objects are flexible – you can add new properties or change existing ones anytime!
Deleting Properties
Use the delete keyword to remove something.
Objects Inside Objects (Nested)
You can put objects inside other objects – great for more details!
Quick Fun Quiz
Hemos revisado y comprobado los materiales, pero aún pueden existir errores. El contenido se ofrece únicamente con fines educativos, así que úsalo bajo tu propia responsabilidad y verifica con otras fuentes si es necesario.
✨ Pregunta a Lara — tu compañera de estudio con IA
Desbloquea soporte de aprendizaje personalizado. Lara puede explicar lecciones, resumir temas y responder tus preguntas — disponible desde el plan Go y superiores.
Lara te ayuda a aprender más rápido — exclusivo para los miembros ReadyTools Go, Plus y Max.


