17.11.2015 Views

JavaScript_Succinctly

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7<br />

Instances created from a constructor function are linked to the constructor’s<br />

prototype property ................................................................................................. 123<br />

Last stop in the prototype chain is Object.prototype ........................................ 124<br />

The prototype chain returns the first property match it finds in the chain .............. 124<br />

Replacing the prototype property with a new object removes the default constructor<br />

property ................................................................................................................... 125<br />

Instances that inherit properties from prototype will always get the latest values . 126<br />

Replacing the prototype property with a new object does not update former<br />

instances ................................................................................................................. 127<br />

User-defined constructors can leverage the same prototype inheritance as native<br />

constructors ............................................................................................................. 128<br />

Creating inheritance chains (the original intention) .................................................. 130<br />

Chapter 15: Array() .................................................................................................. 131<br />

Conceptual overview of using Array() objects ....................................................... 131<br />

Array() parameters ................................................................................................ 132<br />

Array() properties and methods ............................................................................ 132<br />

Array object instance properties and methods ......................................................... 132<br />

Creating arrays ........................................................................................................ 133<br />

Adding and updating values in arrays ...................................................................... 134<br />

Length vs. index....................................................................................................... 135<br />

Defining arrays with a predefined length ................................................................ 135<br />

Setting array length can add or remove values ....................................................... 136<br />

Arrays containing other arrays (aka multidimensional arrays) ................................. 136<br />

Looping over an array, backwards and forwards ..................................................... 137<br />

Chapter 16: Math Function........................................................................................ 139<br />

Conceptual overview of the built-in Math object....................................................... 139<br />

Math properties and methods .................................................................................. 139<br />

Math is not a constructor function ............................................................................ 140<br />

Math has constants you cannot augment or mutate ................................................ 140<br />

Review ........................................................................................................................ 141

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!