Object Methods in JavaScript

ObjetosFunciones

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

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.

Sigue Tu Progreso 🚀

Aprende más fácilmente siguiendo tu progreso completamente gratis.