Fiber.jsJavaScript 對象繼承模型
Fiber.js 是來自 Linkedin 的一個輕量級的 JavaScript 對象繼承模型。
示例代碼:
// Animal base class
var 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評論
圖片
表情
