Nested JavaScript Functions as Objects
(Page 1 of 5 )
In this conclusion to a three-part series on nesting JavaScript functions, we see how nested functions can be used as object types. We shall make it simple. We shall consider only the case where there is only one level of nested functions.
By this, I mean that you can have an outer function and then you have one or more nested functions. The nested functions are of the same level. None of the nested functions nests any other function.
We have not seen this situation in the series. However, it is still a simple model. These nested functions can become object methods.
In this part of the series, more emphasis will be on the methods of objects than on the properties of objects, since we are more interested in the behavior of the nested functions.
Recalling JavaScript Objects basics
In JavaScript the class of an object is called the Object Type. The Object Type does not refer to any object. That is, it does not refer to any object instance or member of an object class. In JavaScript the word "object" refers to an instance of the object; that is, a member of the object type (object class).
In this section I recall the basics of object types. If the information is not enough for you, then you should consult some other source that gives you an in-depth analysis of JavaScript object types and objects.
Next: Constructor Function >>
More JavaScript Articles
More By Chrysanthus Forcha