Fiber.js是来自Linkedin的一个轻量级的JavaScript对象继承模型。
示例代码:
// Animal base classvar Animal = Fiber.extend(function() { return { // The `init` method serves as the constructor. init: function() { // Private function private1(){} function private2(){} // Privileged this.privileged1 = function(){} this.privileged2 = function(){} }, // Public method1: function(){} }});var animal = new Animal(); // Create a new Animal instance
评论