to start this off, we could return to our person object type from our first objects article, which defines the generic data and functionality of a person. from our class, we can create object instances — objects that contain the data and functionality defined in the class. first of all, we’d like you to make a new local copy of the oojs.html file we saw in our first objects article.
you can now see that we have two new objects on the page, each of which is stored under a different namespace — when you access their properties and methods, you have to start calls with person1 or person2; the functionality contained within is neatly packaged away so it won’t clash with other functionality. you can now see that you can access the properties and methods just like we did previously — try these in your js console: note: if you are having trouble getting this to work, try comparing your code against our version — see oojs-class-finished.html (also see it running live). first of all, you can use the object() constructor to create a new object. this article has provided a simplified view of object-oriented theory — this isn’t the whole story, but it gives you an idea of what we are dealing with here.