We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
策略模式:定义一系列的算法,把它们一个个封装起来,并且使它们可以相互替换。
var strategies = { 'A': function(salay){ return salay * 6; }, 'B': function(salay){ return salay * 4; }, 'C': function(salay){ return salay * 3; }, 'D': function(salay){ return salay * 2; } } var calculateBouns = function(level,salary){ return strategies[level](salary); } console.log(calculateBouns('A',20000)) console.log(calculateBouns('B',20000))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
策略模式:定义一系列的算法,把它们一个个封装起来,并且使它们可以相互替换。
The text was updated successfully, but these errors were encountered: