Skip to content

Instantly share code, notes, and snippets.

@GeekaholicLin
Created August 25, 2016 12:43
Show Gist options
  • Save GeekaholicLin/80047d61c0e7555e9cc44b5dad9915b7 to your computer and use it in GitHub Desktop.
Save GeekaholicLin/80047d61c0e7555e9cc44b5dad9915b7 to your computer and use it in GitHub Desktop.
js 学习笔记(杂)

函数对外提供接口的一个方法是,将函数内部的变量、内部函数挂载到window全局对象下即可

(function(){
 function $(){
  //do sth.
 }
  window.$ = $;
})();
$();//succeed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment