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
定义:指对象有某个行为,但是在不同的场景中,该行为有不同的实现算法
const activityObj = { special(price){ return price * 0.6 }, secondsKill(price){ return price * 0.5 }, activity(price){ return price * 0.9 } } const askPrice =function(type,money) { return activityObj[type](money); }; console.log(askPrice('special',10000)); // 6000
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: