Guest User

Untitled

a guest
Dec 12th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. var after = function(times, func) {
  2. return function() {
  3. if (--times < 1) {
  4. return func.apply(this, arguments);
  5. }
  6. };
  7. }
  8. //下面用做用演示
  9. var function test(){
  10. console.log("test");
  11. }
  12.  
  13. var res=after(2,test);
  14. res();
  15. res();//显示test
Add Comment
Please, Sign In to add comment