Request Dev Services ยป / Notes /

Working with Object Methods in JavaScript (live demo!)

Methods are very useful, especially pertaining to Object Oriented JavaScript; a demonstrable example could be organizing the front-end of content from an API source, so it displays custom to how you want it, so it meets your custom design or functionalities needs.

For a hypothetically project of mine, if I wanted to create a movie database type website, I could have an ‘Action Movies‘ category and simply divide up the API data from that Obj to display to my liking within my interface. For example, below I’ll create a ‘Brief Summary‘ for the movie content section ‘header‘, and then a ‘Full Description’ content section – I could later have with the CSS of this and allow it to appear on hover, toggle, or similar.

Sample (below) or view in new window.

“Methods are functions stored as object properties.” – W3C

About the Author
Cameron Cashwell Web Developer
I build websites, web apps, and software. Wanna work together? Let's chat about your project!

Leave a Reply

Be the First to Comment!

Notify of