Home » Posts tagged "properties"

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”

C# Properties Get and Set

My son is learning to program.  Last week he asked me to explain C# properties get and set and, as it turns out, it looks like many others are asking for the same.  So, I’ve decided to spend the time on this post, explaining getters and setters in about as much detail as one can expect.

So here it goes…

Continue reading “C# Properties Get and Set”