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
Wir haben die Materialien überprüft, dennoch können Fehler vorkommen. Der Inhalt dient ausschließlich Bildungszwecken, daher verwende ihn auf eigene Verantwortung und überprüfe ihn bei Bedarf mit anderen Quellen.
✨ Frag Lara — deine KI-Lernpartnerin
Entsperre personalisierte Lernunterstützung. Lara kann Lektionen erklären, Themen zusammenfassen und deine Lernfragen beantworten — verfügbar ab dem Go-Tarif.
Lara hilft dir, schneller zu lernen — exklusiv für ReadyTools Go-, Plus- und Max-Mitglieder.

