So today I am reading through this book pro-javascript design patterns, excellent book by the way! I had come upon chapter 2, which was an excellent explanation of interfaces. One thing that concerned myself is that the book states that it is impossible to create enforceable interfaces in javascript. I pondered that for a bit, as far as what interfaces really are. If you look at interfaces from the perspective of java, then for the most part they are types, with a specified subset of methods for a class instance.

Thinking in those terms, I sat back and pondered the problem again, sooo all I need to do really to create interfaces that are enforceable in javascript would be to seperate the concept of an interface from a class all together and make it a class its self! WALA! True first class interfaces in javascript!

I have a full example of javascript interfaces here