Tiffany R. White Blog

Dark Mode
Light Mode

What is the Difference Between a Function and a Method? Terminology Pt. 1

February 05, 2019 • ☕️ 1 min read

Abby Snopek tweeted the following:

In short: a method is a function that belongs to a class. In JavaScript, however, a method is a function that belongs to an object.

Everything in JavaScript is an object; a function is an object; an Array is an object. This is a quirky design decision, but because most everything in JavaScript is an object, we can do neat things with Prototypal Inheritance. The nice thing about prototypal inheritance is that we can manipulate several different properties on the prototype chain at once.

Give that above article a read for more information. Also, check out the Inheritance and the prototype chain article on MDN.


Sign Up for the Newsletter. No spam. I hate that, too.


Buy Me A Coffee

Share article
LinkedIn

Discuss on TwitterEdit on GitHub


Tiffany R. White Blog

Tiffany White

Blog of Tiffany White. Thoughts on React & web development. My stuff: /uses.