# JavaScript Overview – Objects and Arrays

In JavaScript, any non-primitive value is considered to be an object; a property that has a name and a value, which can either be a primitive value or another object. While an object is essentially an unordered collection of named values, an array is an ordered collection of numbered values.

Within JavaScript, objects are dynamically typed:

- Every object is a dictionary of properties.
- Each property is a name-value pair.
- Properties are added and removed at run time.

Properties are inherited from a prototype object:

- As if each new object is a copy of its prototype.
- The prototype may in turn derive from a prototype of its own.

To create a new object, use a comma-separated list of name:value pairs, as shown below:

                var myrectangle = {
    	width: 100, height: 50,
    	"return": {a:1, b:2, c:3},
    	getArea: function() {
    	   return this.width * this.height;
    	}
    };