JavaScript Inheritance and Object Programming

Coding Tutorial, Chapter 6b

Program the Capability

© 21 July, 2013, Martin Rinehart


After your mainline has a box that implements Maskable you may call box.Maskable.mask() and box.Maskable.unmask() and you will be rewarded with alert()s that indicate your capability is completely programmed. The DOM-manipulating details of launching and deleting masks are left up to you. (See the text for a brief discussion of the hurdles involved.)


The implements() method created the Maskable property for your Box. Here you make it an object, have its owner property refer back to your Box and provide mask() and unmask() methods.

The final step is to implement and use your capability in the mainline for at least one of your Boxes.

The complete source file.

Feedback: Martin Rinehart at gmail dot com.

# # #