JavaScript Inheritance and Object Programming

Coding Tutorial, Chapter 4e

Composition: Create a Box.set_borders() Method

© 21 July, 2013, Martin Rinehart


View your default-bordered boxes (with those ugly red borders). Then call your new set_borders() method to create some nice 'ridge' and 'groove' borders in a complementary color. That's better, isn't it?


The set_borders() method could hardly be simpler.

To test, add a new last line to a box in the mainline. (Use your own ideas about good-looking borders.)

The complete source file to this point.

Feedback: Martin Rinehart at gmail dot com.

# # #