This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Sale(price) { | |
this.price = price || 100; | |
this.decorators_list = []; | |
} | |
Sale.decorators = {}; | |
Sale.decorators.fedtax = { | |
getPrice: function(price) { | |
return price + (price * 5/100); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Sale(price) { | |
this.price = price || 100; | |
} | |
Sale.prototype.getPrice = function() { | |
return this.price; | |
}; | |
Sale.prototype.decorate = function (decorator) { | |
var F = function(){}, | |
overrides = this.constructor.decorators[decorator], | |
i, newobj; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Webpack 目前設定檔 | |
[TOC] | |
## 套件安裝 | |
* 主要套件 : `webpack` | |
* ESLint 檢查: `eslint eslint-loader eslint-plugin-react` | |
* Babel (ECMAScript6 語法轉換) : `babel-core babel-loader babel-preset-es2015` | |
* React 相關套件: `react rect-dom jsx-loader babel-preset-react` |
NewerOlder