JavaScript Inheritance and Object Programming

Coding Tutorial, Chapter 4b

Composition: Get Styles from Borders

© 21 July, 2013, Martin Rinehart


We use the simple alert() method (the same one we used when we created the Borders class) to test both our get_styles() method and our new toString().


The new get_styles() method is an instance method. That means it goes into the prototype.

It also provides a new way of looking at the object, which we use in our toString() method.

Feedback: Martin Rinehart at gmail dot com.

# # #