函数的柯里化
bind() ES5新增方法
主要作用:将函数绑定到某个对象中,并且有返回值(一个函数),可用于函数的柯里化,对于不同模块配置不同的参数
function getConfig(color, size, otherConfig){
	console.log(color, size, otherConfig);
}
let defaultConfig = getConfig.bind(null,"#fff",20*30)
defaultConfig(123); // #fff 600 123
defaultConfig(456); // #fff 600 456
                    
                
                
            
        
浙公网安备 33010602011771号