How to implement interfaces in Javascript

Those code samples are taken from "Pro JavaScript™ Design Patterns".