文章出處

for Function

github: https://github.com/laixiangran/commonJS/blob/master/src/forFunction.js

代碼

/**
 * Created by laixiangran on 2016/1/24
 * homepage:http://www.cnblogs.com/laixiangran/
 * for Function
 */

(function(undefined) {

    var com = window.COM = window.COM || {};

    com.$F = (function() {
        var slice = Array.prototype.slice;
        return {
            bind: function(fun, thisp) {
                var args = slice.call(arguments, 2);
                return function() {
                    return fun.apply(thisp, args.concat(slice.call(arguments)));
                }
            },
            bindAsEventListener: function(fun, thisp) {
                var args = slice.call(arguments, 2);
                return function(event) {
                    return fun.apply(thisp, [window.COM.$E.fixEvent(event)].concat(args));
                }
            }
        };
    }());
}());

參考

http://www.cnblogs.com/cloudgamer/


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()