Home » Posts tagged "fields"

JavaScript Object Fields

Last week as I was discussing the basics of JavaScript Objects, I kept referring to the members of the object as “fields.”  Never did I call them properties or methods.  This is because all members that are hanging off of an object are treated the same, from a membership perspective.  It is the type of data it contains that makes it behave as what we would normally refer to as a property or a method.

This is an important distinction. In a strongly typed system, we can say that a member of our object is a property or method simply because it was defined as one or the other when we defined our class.

In JavaScript we have neither classes where we can define what something is, nor strong typing. So, how something functions is determined by the type of variable it is pointing to at run time.

JavaScript Fields

Continue reading “JavaScript Object Fields”