Le 20/12/2014 13:47, Gary Guo a écrit :
bindParameter function is not very hard to implement:
```
Function.prototype.bindParameter=function(idx, val){
    var func=this;
    return function(){
        var arg=Array.prototype.slice.call(arguments);
        arg[idx]=val;
        func.apply(this, arg);
    }
}
```
It's even easier if you use bind ;-)

Function.prototype.bindParameter = function(...args){
    return this.bind(undefined, ...args)
}

David
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to