We are using Prototype.js framework for OOP. I know you can do class inheritance easily. You can do callbacks easily. So, is there a way to implement an OOP "interface"? Or, do we have to stay with class inheritance?
Asked
Active
Viewed 411 times
1
-
Also, is there a better way to implement OOP in javascript? – biajee Aug 08 '12 at 18:22
-
Javascript does OOP just fine, if you don't get hung up on trying to do it like Java does. :) – cHao Feb 11 '13 at 05:37
-
1Highly related: http://stackoverflow.com/questions/3710275/does-javascript-have-the-interface-type-such-as-java-interface/3710367#3710367 -- my answer goes a bit into why JS doesn't have Java-style interfaces (and to a degree, why they wouldn't be worth having anyway). – cHao Feb 11 '13 at 05:40