Skip to content

Instantly share code, notes, and snippets.

@KJlmfe
Created April 25, 2014 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KJlmfe/11276425 to your computer and use it in GitHub Desktop.
Save KJlmfe/11276425 to your computer and use it in GitHub Desktop.
JavaScript 设计模式 - Adapter(适配器模式)-1
//旧的第三方代码
function getSomething(str1, str2, str3) {
// do some thing
console.log("Old getSomething");
return str1 + str2 + str3;
}
//自己的代码
var str1 = "a",
str2 = "b",
str3 = "c";
console.log(getSomething(str1, str2, str3));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment