JavaScript contains a data structure called Objects. Objects help you organize code and they make it easier to work with in certain cases. There are two ways of creating objects: by using an object initializer or by using constructor functions. In this chapter we’ll create a single object using an object initializer, while constructor functions act as a blueprint from which we can create many object instances using the new keyword.
Using Object Initializer
JavaScript uses a data structure called Object that helps organize data together. There are a couple of ways of creating an object in JavaScript. ...