Object Methods in JavaScript
Objects can do things too! We can put functions inside objects (called methods) so the object can "act". There are also built-in tools from the Object class to work with properties.
Let’s learn the most useful ones with everyday examples – like a robot that can greet you!
Methods – Functions Inside Objects
A method is just a property that is a function. Use 'this' to refer to the object itself.
Shorter way with arrow? Careful – arrow functions don’t have their own 'this'!
Object.keys, values, entries
These give you arrays of keys, values, or both.
Checking Properties
Freezing Objects
Make an object unchangeable with Object.freeze()
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.


